Controlling iTunes using Quicksilver… X-Tunes Keystrokes Work!
Thursday, September 20th, 2007I love X-Tunes, and have been using it on my MacBook Pro, using my old PowerBook's configuration files. Finally, I've gotten tired of the Rosetta-induced weird slowdowns, and other strangenesses associated with it not being Intel-compatible. There is a pretty easy solution using Quicksilver, another app I run in the background. If you are unfamiliar with this software, you should probably take care of that. Anyway, it allows you to assign hotkeys (including my favorite, command-space). The easiest solution is to switch to the iTunes window when you press the combo (X-Tunes switched to it's mini-iTunes window), and then switch back to whatever you were doing on the upstroke (the X-Tunes window would disappear).
Unfortunately, there are no built-in ways to switch to iTunes on the press, and switch back to your app on the release, so I had to roll my own. It is a 27 line interface-less Cocoa script that checks what app is running, if it's iTunes, it switches to the last app in it's memory. If it's not iTunes, then it switches to iTunes, and stores the current app in memory. So, you just set it up to be executed on the press and release of your favorite keystroke. Then, when you press your combo, iTunes pops up (and left/right/up/down control song and volume). Unfortunately, I haven't figured out how to get the return key to trigger the play/pause action only in iTunes. If I come up with something, I'll pass it along.
The Tutorial:
Step 1:
If you don't have it already, download and become familiar with Quicksilver. Then download ITToggle. Decompress them and stick the Release/ITToggle file somewhere where you will remember, say, ~/Library/Application Support/Quicksilver/Scripts/ or ~/Library/Scripts or ~/.bin/ or whatever you're comfortable with. You will have to get to it later, so remember where you stick it.
Step 2:
Enter Quicksilver, and bring up triggers, and select custom triggers.

There are a few of my favorite triggers in there, but if you have none, that's OK too. Add a trigger by hitting the "+" icon in the bottom right.
Navigate to ITToggle, using Quicksilver, and as the action select "Run (Shell Script)" (you may have to add the plugin for this), not Open. If you select open, it will open it using Terminal, and that will make the whole thing pointless, because Terminal is totally unnecessary. Make sure it looks like it does here:

Step 3:
Now you have the step set up, but there is no trigger associated with it, so we'll have to add one. Double-click the area that is set aside for the "Trigger". This will open up the info drawer, and we can change things from there. Set the keystroke as you wish, and make sure the it it is set up to be on press and release, as seen here:

Now it should work (just not from Quicksilver, for some reason), try it from Safari or something. Press should take you there, and release should take you back.
It is easy to modify the WebExport templates to work with other themes. Install the theme by double-clicking it, or moving it to ~/Library/Application Support/WebExport (which you may have to create).
Don't panic! Select the wordpress template from the drop-down, and see the "pathToRoot=../../" pop up. This string tells the template how to get to your main wordpress directory from the directory it lives in. You can edit the titles/authors of the images in the "Metadata" tab (you can save it back to iPhoto for easier editing).
Click "Export" at the bottom of the page, and navigate either to the location you have WordPress installed in (it should have all kinds of wp-stuff.php files in it), you can also export to a temporary directory, and upload it to your website. Create a folder inside the wordpress directory called "galleries", and another one inside that one with a UNIX-ized version of your gallery name (My Favorite Photos -> my_favorite_photos). Select this directory and click "OK". Wait while WebExport does it's thing, and when it's done, open up that page on your webserver (local viewing won't let the PHP work).