Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

nelly22

macrumors 6502
Original poster
Sep 29, 2009
366
5
I been trying in past few weeks to make my AppleScript to read and write preferences to plist file.

I now know how to read/write using defaults to top level of plist file, but if i try to read/write more complex data to array then things get complicated.

Similar array what i try to do is BrowserWindowState in com.apple.finder.plist.

Could anybody help me or share subroutine which does this?

Thanks
 
If you are not just doing key-value pairs then the 'defaults' command is going to make like really difficult (you have to re-write the entire entry in the root dictionary every for every change). The next step that many admins take is to use PlistBuddy (a search should get you going with that), but there are so many oddities about using that that I usually skip it and use Python scripts with the scripting bridge (Py-ObjC, but the Ruby or Perl bridge would work just the same) and call in to NSPropertyListSerialization.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.