5/02/2009
Scenario: You’re working with the Flex SDK and you’re tracing messages to the Terminal via flashlog.txt. The damn logfile has heaps of clutter in it from the last project you were working on, and you want to clean it up.
Solution: Save this snippet and assign it a Quicksilver hotkey:
1 2 3 4
| try
do shell script "rm ~/Library/Preferences/Macromedia/Flash\ Player/Logs/flashlog.txt"
do shell script "touch ~/Library/Preferences/Macromedia/Flash\ Player/Logs/flashlog.txt"
end try |
Result: You are happy. Go drink beer.
17/01/2009
Scenario: You are browsing in Safari (because it’s speedier than Firefox) and feel the urge to inspect the site in Firebug or the Web Dev Toolbar.
Solution: Save this script and activate it from QuickSilver.
1 2 3 4 5 6 7 8 9 10
| tell application "Safari"
activate
set theUrl to the URL in document 1
end tell
tell application "Firefox"
activate
OpenURL theUrl
end tell |
Result: You are happy. Have a coffee.
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!
1/08/2008
Summary: In which Martin has created an AppleScript to remedy Firefox’ poor support for
OmniFocus‘ “Send to inbox” hotkey. This is a lengthy post with lots of dreary explanations, so you might want to
jump to the finished script if you don’t care about how stuff works.
Edit: An alternative version brings up your Quick-add dialog and populates it. Check this comment if that sounds more appealing.

To get this to work you’ll need Quicksilver. But you’ve got that haven’t you? Sure you do.
I’m trying out OmniFocus nowadays for my obsessive-but-not-GTD-level organizing needs. It’s still a tad overkill for what I need, but they have the best iPhone sync so far, and I assume I’ll just be assimilated into the cult of David Allen sooner or later so what the hell.
One of the things I like about OmniFocus is the “Create Clipping” functionality. OmniFocus allows you to at a keystroke (♥) send whatever text is currently selected to your Inbox as a clipping.
However this isn’t working in Firefox 3. Mozilla practically stripped all the scripting abilities in v2 and i suppose that’s what goes for a “feature” nowadays. This needs some serious fixing. Let’s get our hands not-really-dirty-but-maybe-a-bit-smudged.
Edit: I’ve updated the script with a new version that also grabs the URL of the clippings origin.
Read the rest of this article »
18/06/2008
I couldn’t possibly code in anything but TextMate. Hell, I even blog from TextMate. And since I’m lazy by nature I wanted a better way to import classes from my class library. The TextMate ActionScript 3 Bundle Simon Gregory offers a nice auto complete functionality that lets you define a list of classes to choose from on triggering.
While this is indeed very nice, the solution is really only suited for your most frequently used classes as putting your entire class library in the list would render it unusable. So something else was needed.
Read the rest of this article »