iTunes 4.5, Fast User Switching and AppleScript

May 21, '04 09:12:00AM

Contributed by: mattinsyd

I use iTunes on my desktop computer but spend most of my time working on my PowerBook. I have a couple of scripts on my PowerBook to pause and play iTunes on the desktop machine. Now that iTunes 4.5 will still play while switched to another user I wondered what would happen with my scripts. On the desktop computer, I left iTunes playing and then switched to another user. On my PowerBook, I ran my AppleScript to pause the music. iTunes on the desktop paused the music playing. My play script then started it again.

Next I wondered what would happen if I ran the scripts on the desktop computer but from the active account. When AppleScript asked me to authenticate I gave the username and password for the account where iTunes was playing. It did exactly as it had done on my PowerBook, controlling iTunes in the other account.

The code is quite simple:

tell application "itunes" of machine "eppc://g3desktop.local." to pause
Of course, this requires any account on the desktop computer to have my password if I want to control it on the same machine, but I was just interested in controlling iTunes from my PowerBook.

Comments (2)


Mac OS X Hints
http://hints.macworld.com/article.php?story=20040520004016598