Changing desktop settings with PlistBuddy

Valued Contributor

I'm using a modified version of Rich Trouton's first_boot script to test a bunch of configurations for a new Yosemite build.

At the moment I'm having a problem with PlistBuddy and changing some desktop defaults. It seems that the first two settings in the give an error, but the third is fine.

/usr/libexec/PlistBuddy -c "Set :DesktopViewSettings:IconViewSettings:arrangeBy grid" "${USER_HOME}"/Library/Preferences/
/usr/libexec/PlistBuddy -c "Set :FK_StandardViewSettings:IconViewSettings:arrangeBy grid" "${USER_HOME}"/Library/Preferences/
/usr/libexec/PlistBuddy -c "Set :StandardViewSettings:IconViewSettings:arrangeBy grid" "${USER_HOME}"/Library/Preferences/

Is this and issue with PlistBuddy or with the plist file or with Yosemite?

One thought is that maybe those arrays (?) don't exist in the default plist file, and PlistBuddy can't add them?


Release Candidate Programs Tester

@cwaldrip, you'll probably be hitting OSX's preference caching. (

It depends on what you're targeting with the script & what errors you were getting.

PlistBuddy is still valid when modifying unloaded plists.