Re: Remove icon from dock after adding it
Re: Remove icon from dock after adding it
- Subject: Re: Remove icon from dock after adding it
- From: Luther Fuller <email@hidden>
- Date: Fri, 24 Jul 2009 08:36:02 -0500
On Jul 24, 2009, at 1:05 AM, Chris Page wrote: On Jul 23, 2009, at 10:21 AM, Laine Lee wrote: killall Dock
Two notes:
1. Don't use "killall Dock". That unilaterally kills the Dock process without giving Dock a chance to commit any unsaved changes. Instead, send the Dock a "quit" event.
2. Before you modify the preferences, quit the Dock so it will commit any unsaved changes. Then modify the preferences, then quit the Dock again to ensure it sees the new preferences—because it automatically relaunches and may do so before your preferences changes are committed.
I currently use this code snippet to add an item to the Dock ...
set prefsFile to (((path to preferences from user domain) as text) & "com.apple.dock.plist") as alias tell application "System Events" set dockPath to (prefsFile as text) set dockRec to (value of property list file dockPath) set |persistent-others| of dockRec to ((|persistent-others| of dockRec) & {newMenuFolderItem}) set (value of property list file dockPath) to dockRec end tell tell application "Dock" to quit
Are you recommending that I also quit the Dock before this snippet? And if I do that, do I really need to quit after? How long is the Dock dormant after the quit command?
|
_______________________________________________
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