• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Setting a .plist value?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Setting a .plist value?


  • Subject: Setting a .plist value?
  • From: Brian Christmas <email@hidden>
  • Date: Sat, 06 Feb 2016 10:54:12 +1100

G’day scripters.

I’ve struck a problem in El Capitan where Dock icons that are dragged  off are not removed from the permanent .plist Dock Preferences.

I want to restore any ‘invisible’ dock icons that are still listed, via applescript, but can’t get my terminology correct.

Any guidance, please?

Regards

Santa

set plistpath to (path to preferences folder as text) & "com.apple.dock.plist"
tell application "System Events"
set plistContents to contents of property list file plistpath
set pListItems to value of plistContents
end tell
set persistentAppsList to |persistent-apps| of pListItems
set persistentApps to items of pListItems
set dockAppsList to {}
try
repeat with thisRecord in persistentAppsList
set theTileData to |tile-data| of thisRecord as record
if (|file-label| of theTileData as text) is "Mail Manager" then
say 1
tell application "System Events"
tell property list item |tile-data| of property list item thisRecord
set value of property list item "showas" to "1"
end tell
end tell
set end of dockAppsList to (|file-label| of theTileData as text)
end if
end repeat
end try
tell application "Dock" to quit
dockAppsList & return & persistentApps
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden

  • Follow-Ups:
    • Re: Setting a .plist value?
      • From: Shane Stanley <email@hidden>
  • Prev by Date: Re: Picking your brains about dates and times
  • Next by Date: Re: Setting a .plist value?
  • Previous by thread: Pulling links from email and pdf'ing webapges
  • Next by thread: Re: Setting a .plist value?
  • Index(es):
    • Date
    • Thread