Re: Need to remove Dock icon
Re: Need to remove Dock icon
- Subject: Re: Need to remove Dock icon
- From: Brian Christmas <email@hidden>
- Date: Wed, 14 Sep 2016 10:30:58 +1000
G’day Shane, and thank you. Thank you also, Yvan.
Whilst I note your concerns, I haven’t found any other methods on the net to delete a running Apps Dock icon, so I want to at least see if I can get this to work.
I’ve updated the script as below, and while it now shows more than the basic list of icons, it’s still only showing about half of the originals. Do I need to somehow force an update of the .plist file?
Any thoughts, please? (Anyone else want to chip in?)
Regards
Santa
property NSUserDefaults : class "NSUserDefaults" of current application
tell NSUserDefaults tell application "System Events" set dockPlistFile to property list file "~/Library/Preferences/com.apple.dock.plist" tell dockPlistFile tell property list item "persistent-apps" set appTileItems to value of every property list item whose value of property list item "tile-data"'s property list item "file-label" is not "Christmas Wonderland 6" set its value to appTileItems end tell end tell end tell end tell do shell script ("killall Dock”)
On 14 Sep. 2016, at 9:57 am, Shane Stanley < email@hidden> wrote: On 14 Sep 2016, at 7:16 AM, Brian Christmas <email@hidden> wrote:
Obviously Sierra does not like the code.
Any thoughts on how I can do this, or what’s wrong with this code, please? I’ve tried everything I can think of.
The problem is that your code is based on a misunderstanding of how the defaults process works. The property list files are read by a daemon the first time an app runs, and the app talks to that daemon. The daemon periodically writes updated values to the file, but it doesn't need to read from it again until either a restart, or it decides to clear out old values after an app has quit. So fiddling with the files is unreliable at best, and useless at worst.
Use defaults via do shell script or NSUserDefaults. They are the only way to talk to the defaults daemon.
-- Shane Stanley <email@hidden> <www.macosxautomation.com/applescript/apps/>, <latenightsw.com>
And what, you ask, was the beginning of it all? And it is this...... Existence that multiplied itself For sheer delight of being And plunged with numberless trillions of forms So that it might find itself innumerably
Sri Aurobindo
|
_______________________________________________
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