I manage my iTunes library on my iMac, but I got a headless Mac mini for streaming purposes to which I regularly synchronise the iTunes library via a shell script (run on the mini):
osascript -e "try" -e 'tell app "Finder" to mount volume "smb://imacuser@iMac.local/imacuser"' -e "end try"
osascript -e 'tell app "iTunes" to quit'
rsync -av --force --delete --size-only /Volumes/imacuser/Music/iTunes/ /Users/miniuser/Music/iTunes/
osascript -e 'tell app "iTunes" to run'
osascript -e 'display notification "Done." with title "Synchronising"'
This works well, but afterwards both libraries can be found under the same name when using "Remote", for example. So the last thing I have to do on the mini is to go to iTunes preferences and change the library name.
Can I automate this last step somehow via AppleScript?
Best Answer
Yes, I can. I can automate the mouse keyboard actions necessary by scripting System Events. Since the AppleScript part of my shell script got bigger and bigger I converted into an AppleScript and called the shell from there: