This is an excellent thread and let me first thank you guys for answering the ‘How the heck did they DO that?!’ question about that toggle shuffle behavior.
Not to threadjack, but - I’m trying to do this, and all of the other iTunes behaviors (toggle play / pause) in a series of scripts that will work with netTunes from Shirt Pocket software, in order to control iTunes running on another machine (running a netTunes server instance) from multiple ‘client’ machines.
I’m implementing the excellent toggle shuffle script listed above but I wondered if anyone might suggest a way to improve on the ‘dialog’ display suggested above by slimjim5811… to display a Quartz-type notification on the screen when shuffle is turned on and off.
If you’re interested in seeing exactly what I mean, I suggest downloading the excellent app SizzlingKeys from YellowMug software. It’s free, with the exception of a few ‘Pro’ features – like (ironically enough!) the Toggle Shuffle command. Heh. Okay, so if you don’t want to pay $5 to see what I mean then try the ‘Volume Up’ and ‘Volume Down’ hotkeys instead. They show the little grey transparent rounded rectangle on the screen, with the white volume bar symbol in it. The toggle shuffle just has the intertwined arrows instead.
So, anyone know how I could replicate this?
-
-
- Nevermind, I just answered my own question, heh. Here’s how:
Step 1: I downloaded Growl and installed the prefPane. I picked the ‘Bezel’ notification style.
Step 2: I installed the ‘growlnotify’ shell script from the Extras folder. But that’s just for purposes of this example, you’ll probably want to use (duh) AppleScript, and that’s left as an exercise for the reader.
Step 3: I ransacked SizzlingKeys for it’s Shuffle state images (Apologies to Jay Teo!) by going to /Applications/Utilities/SizzlingKeys4iTunes.app and doing ‘Show Package Contents’, then navigating to Contents/Resources and grabbing the files shuffle_on.png and shuffle_off.png. I put them in a personal projects directory.
Step 4:
> echo "Shuffle On" | growlnotify --image /Users/thom/Projects/personal/home_AV/netTunes_applescript_SizzlingKeys/shuffle_on.png
> echo "Shuffle Off" | growlnotify --image /Users/thom/Projects/personal/home_AV/netTunes_applescript_SizzlingKeys/shuffle_off.png
…et voila, you have a working quartz-like notification.
So, as you can see, I’m trying to have my scripts replace as much of the functionality of SizzlingKeys as possible, because I need them to do double duty: BOTH control the local iTunes instance… and the remote iTunes instance via netTunes. (Which one they do would depend on a boolean I’d set somewhere and toggle on/off with another hotkey.)
Speaking of which… anyone have any experience setting custom user defaults via Applescript? I’m thinking of com.unithom.iTunesRemoteLocalControl as my ‘defaults’ path, to make it unique.
Thanks! Hope this is helpful.