• 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
Re: Remove icon from dock after adding it
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Follow-Ups:
    • Re: Remove icon from dock after adding it
      • From: Chris Page <email@hidden>
References: 
 >Re: Remove icon from dock after adding it (From: Laine Lee <email@hidden>)
 >Re: Remove icon from dock after adding it (From: Chris Page <email@hidden>)

  • Prev by Date: Re: Login window
  • Next by Date: Re: Photoshop Action
  • Previous by thread: Re: Remove icon from dock after adding it
  • Next by thread: Re: Remove icon from dock after adding it
  • Index(es):
    • Date
    • Thread