Posted on 09-13-2012 05:20 PM
I am looking to create a script that would create a user defined Folder in System Preferences > Desktop and Screensaver > Folder Path. I believe I've tracked down the location where this value is defined. I'm wondering if I could use a defaults write command....
Plist: com.apple.desktop
<key>Background</key>
<dict>
<key>spaces</key>
<dict>
<key></key>
<key>0</key>
<dict>
<key>DSKDesktopPrefPane</key>
<dict>
<key>UserFolderPaths</key>
<array>
<string>/Library/Desktop Pictures/2012.09</string>
</array>
</dict>
</plist>
Posted on 09-13-2012 08:01 PM
posted to wrong thread.
Posted on 09-16-2012 05:26 PM
?? Please explain...
Posted on 09-16-2012 05:31 PM
Er, sorry. I meant that I posted to the wrong thread. Since there is no way to delete a post here on JAMF Nation, the only thing I could do was edit my post to the text I wrote above. Sorry for the confusion.
When I get a moment, I will see what I can come up with in a defaults command or possible using PlistBuddy to get you what you're looking for.
Posted on 09-17-2012 09:43 AM
#!/bin/sh
# Setting desktop
rm /Users/$~/Library/Preferences/com.apple.desktop.plist
/usr/libexec/PlistBuddy -c "add Background:default:ImageFilePath string /Library/Desktop Pictures/mydesktop.jpg" /Users/$~/Library/Preferences/com.apple.desktop.plist
An example, change the location, name and user variables you should be good to go
Posted on 09-17-2012 09:50 AM
~/Library might work
but /Users/~/ is not going to do anything useful.
what is $velo
might be more wise to use plistbuddy delete to remove what you want to replace.
if this is running as a launch agent, might want to use $HOME
Posted on 09-17-2012 02:35 PM
$velo is the username variable I use. I edited my post very badly