Problem Adding an Application to the Dock
Problem Adding an Application to the Dock
- Subject: Problem Adding an Application to the Dock
- From: Dave <email@hidden>
- Date: Tue, 17 Jun 2008 17:10:23 +0100
Hi All,
I use the following handler to add a file to the dock. This works really well except if the file is already in the dock, it add it again! I'm having trouble figuring out the shell command to remove the file from the dock.
Any help greatly appreciated.
Thanks a lot All the Best Dave
------------------------------------------------------------------------ -- -- AddFileToDock -- ------------------------------------------------------------------------
on AddFileToDock(theFilePathNameString) --display dialog theFilePathNameString
set myShellCommandString to "defaults write com.apple.dock persistent-apps -array-add '<dict><key>tile-data</key><dict><key>file-data</key><dict><key>_CFURLString</key><string>" & theFilePathNameString & "</string><key>_CFURLStringType</key><integer>0</integer></dict></dict></dict>'"
do shell script myShellCommandString do shell script "sh -c \"killall Dock\"" end AddFileToDock |
_______________________________________________
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