I’m trying to create an applescript app that would change some settings on the computer to my (client’s) desired ones. I’ve figured out how to add apps to login items and turn on password for screen saver and sleep. Now I still need to change the clock to 24h mode and make finder display local hard drives and network mounts on the desktop.
I need to do this either with applescript (this is preferred) or alternatively with bash script if applescript for some reason doesn’t work here.
You can use the following code to set the objects shown on the desktop:
set command to "defaults write com.apple.finder ShowHardDrivesOnDesktop -bool TRUE"
do shell script command
set command to "defaults write com.apple.finder ShowMountedServersOnDesktop -bool TRUE"
do shell script command
set command to "defaults write com.apple.finder ShowExternalHardDrivesOnDesktop -bool TRUE"
do shell script command
-- now we need to restart the Finder
do shell script "killall Finder"
tell application "Finder"
tell Finder preferences
set desktop shows hard disks to true
set desktop shows connected servers to true
set desktop shows external hard disks to true
end tell
end tell
the MenuBarClock can be set to 24 hour mode with
do shell script "defaults write com.apple.MenuBarClock Use24HourClock -bool true"