Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'reading preferences with 'defaults'' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
reading preferences with 'defaults'
Authored by: anoved on Dec 29, '06 03:48:25PM
The location of the dock is stored as the string "left" "right" or "bottom" in ~/Library/Preferences/com.apple.dock.plist. If someone can please let me know how to get the plist stored as a string, it will be very simple to account for left-side docks...

Here's one way:

set dockSide to do shell script "defaults read ~/Library/Preferences/com.apple.dock orientation"

Now dockSide should contain the value of the Dock's orientation preference. Note that in this case the defaults program doesn't need the .plist suffix to be specified.

I think you can read and write preference defaults directly in AppleScript Studio (XCode), but do shell script works for regular scripts.



[ Reply to This | # ]