Archive for the 'Tutorials' Category

Controlling iTunes using Quicksilver… X-Tunes Keystrokes Work!

Thursday, September 20th, 2007

I 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.

step2a.jpg

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:

step2b.jpg

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:

step3a.jpg

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.

How to Make WordPress Photo Galleries With WebExport

Wednesday, July 26th, 2006

Let's Say you have a standard WordPress PHP WebLog running on your server. It looks a little like mine, but you've got a different template and a few other details.

You are happy with this setup, but you want to share more than just text, and have a ton of pictures in your iPhoto library, and want to get them out, and onto your webpage. There are two ways to do this, by hand, or with some software. Clearly, you don't want to do it by hand.

Enter WebExport 1.0IconTemplate.jpg, specially designed to do just this, on my machine (you can check out my photo galleries at mountainmandan.net). Here's how to do it yourself:

First, download WebExport and the WordPress template, which is designed to work with the default WordPress theme and comes in the same tarball. Picture-2.jpg 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).

Boot up iPhoto and select the photos you want to export. Select "WebExport" from the choices at the top of the window, and you will be greeted by a potentially scary looking window. Picture-1.jpg 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).

Now you're ready to export. Picture-3.jpg 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).

Great, now you have a website, but nothing links to it. You can either manually add a link to your sidebar.php theme file, or you can make some PHP code that automatically does that, like in my sidebar.

The final product:

Picture-7.jpg