On Jun 3, 2013, at 7:25 AM, Alex Hall wrote: I didn't realize Applescript had native plist support, that should prove useful. I have things working as I want them to by using a list of tuples, but plists might be handy for other settings in this set of scripts.
It might be helpful to understand exactly what AppleScript's plist support is.
1. You can read the contents of a plist file into a record like this
tell application "System Events" to set prefsRec to (value of property list file (prefsFile as text))
where prefsFile is an alias to a plist file.
2. You can modify the record prefsRec as you like using native AppleScript. (But you will have to know the names or labels of the record keys.)
3. You can write the record prefsRec back to the plist file with
tell application "System Events" to set value of property list file (prefsFile as text) to prefsRec
overwriting the former contents.
You can also read-modify-write a single key within the plist file.
|