9/12/2008

Just encountered bliss deep down in the Quicksilver Google Groups forum. I was trying to save myself a keystroke as usual. More specifically; I often open folders and files in TextMate, and the steps for doing so with Quicksilver are
- 1: Type the first few letters of the folder/file.
- 2: Tab over to the next pane and type “wi” to bring up “Open with” instead of “Open”.
- 3: Tab over to once more and type “te” to bring up TextMate.
- 4: Hit return.
Which is, I suppose, not too bad. However I wanted the flow to be more like this:
- 1: Find the folder/file
- 2: Type in “wi” to bring up a custom action to open the file in TextMate.
- 3: Hit return.
No, it’s not a major step but every single keystroke matters. And besides; This specific action isn’t really the point here.
The point is that to my amazement there wasn’t any simple way to assign a abbreviation to this type of action. That is; an action that needs input in more than one pane. Being a stubborn bastard I started sniffing around on how I could create my own Quicksilver plugin to perform this seemingly simple task. It seemed however that to create a Quicksilver plugin the way to go was Objective-C which I don’t know (the books are shipping from Amazon as we speak). I sat down to make a go at it in XCode, but I just had to give up before I broke something.
Then; Severely undocumented for such a wonderful feature, it turns out that Quicksilver commands can be written in AppleScript. I don’t mean the fact that you can run AppleScripts from Quicksilver, although that’s nice as well. You can actually create commands that’ll behave just like the native commands in Quicksilver, such as “Reveal”, “Copy to…” or “Go to path in Terminal”. With AppleScript being a ridiculously easy language to get started with , this is huge news.
It means that instead of getting to grips with the intimidating world of XCode, my problem could be solved in four human-readable lines:
1 2 3 4
| on open these_items
tell application "TextMate" to open these_items
tell application "TextMate" to activate
end open |
The trick is in the opening line
refers to the current selection in the first pane, and after that you can use the variable
to manipulate with AppleScript all you want. When you’re happy with your script, copy it to ~/Library/Application Support/Quicksilver/Actions and restart Quicksilver. You might also want to go into the Quicksilver preferences and give it a higher priority, or alternatively assign it to an abbreviation.
Have fun!
24/11/2008

The odds are good that you have to keep track on how much time you spend on any individual project for billing reasons or what have you. If you’re anything like me (and why wouldn’t you be) your fantastic right hemisphere of the brain makes you profoundly sucky at performing this dreary task.
Enter On the job, a quite wonderful little app that’ll do the job for you. However; If you are afflicted to the degree I am with this complete and utter incompetence at important but boring chores, you have difficulties even remembering to open the app to let it do it’s thing. ‘Why Martin, it’s simple’, I hear you exclaim, ‘you just put it in your start-up items, so that every time you start up your work computer it’ll launch the app!’ Well, no. You see, I use a MacBook which I carry between the office and home, and my innate loathing of shit starting up each time I start up my Mac would annoy me to no end. Besides, a more than likely scenario would be me quitting the app when going home and then forgetting to start it up again when I’m back at the office. Yes; I’m that terrible.
I considered this while in the shower, as these things are wont to happen, and came up with the idea of trying to make my laptop sniff out which wi-fi I was connected to and thusly be able to perform certain tasks based on that information. I started trying to work out whether it’d be possible to AppleScript a solution, or whether I’d have to try and apply my nigh-non existing Cocoa skills to pull this off.

Ask and ye shall receive. Of course, if there’s a good idea to be had, most likely someone beat me to it. Enter Marco Polo.
This absolute gem of an app promises (and in the 30 mins I’ve used it; Delivers) context awareness for your Mac based on a whole load of criteria. For my purposes all I had to do was to make it sniff out the SSID of my office Wi-Fi and launch On the Job whenever the rule matched. I’ll also be setting it up to launch MediaLink when at home so that I’ll instantly start streaming media to my PlayStation. Yet these examples are just the tip of the proverbial iceberg. The possibilities are, perhaps, not endless but certainly numerous. I highly recommend checking out this killer combo, or just Marco Polo if your short term memory is better than mine (not hard) but context awareness might be interesting for you anyway.
On the job is shareware ($25) and Marco Polo is free as in speech and beer.
12/11/2008
Lately I’ve been teaching a 5 week crash course in ActionScript 3. The first few classes were pretty basic stuff, so ad libbing the whole thing wasn’t too much of a problem. However, as the students got ready for increasingly advanced stuff I had to come up with increasingly advanced projects, and in order to ensure a smooth flow through the allotted three hours of each session, I inevitably had to start bringing notes.
I loathe having to print out anything and for some reason it feels particularly dumb to print out code. Luckily I found DataCase, a $6.99 iPhone app which easily lets you transfer any file to your phone, and lets you view it right there in the application, so you can quickly swap between files. I know there are several apps that has similar functionality, but DataCase seemed to me to be by far the cream of the crop. I wish TextGuru was a tad less buggy and sluggish as it supports a large number of formats, but until then I’ll be using DataCase whenever I need to bring notes with me for any reason. iTunes link.