Skip to main content

Scripting allows for the unanticipated

Even though AppleScript itself might not be my favorite language, the ability to script applications on the Mac never ceases to impress me. By opening up their apps to scripting, developers allow users to do all kinds of things that either wouldn't otherwise be possible, or, better yet, that enable workflows tailored to their own needs and styles of application use.

A great example of this is my own personal use of Potion Factory's excellent task management app, The Hit List. Upon reading over the feature list soon after starting to use it, I discovered that you can drag web URLs out of your browser onto THL's app icon in the dock to create a new todo item to read the link in question.

I tend to queue up a lot of web reading for later, so I wondered if it would be possible to reduce the amount of work required to a single keystroke. My solution consists of three main pieces:

  1. The scriptability of both Safari (my preferred browser) and THL.
  2. Red Sweater Software's excellent FastScripts application, which allows for assigning keystrokes to scripts.
  3. The command-line utility growlnotify, which comes with the desktop notification system Growl.

I was able to combine the three so that by hitting Command-Option-Control-I, the current Safari URL is sent to THL as a new todo in the inbox, posting a Growl notification with the page title to confirm that things went ok.


Click to enlarge screenshot

You can download the script here. Just put it someplace that FastScripts can get to, such as in ~/Library/Scripts, and assign a keystroke to the script in that application's preferences.

My Delicious bookmarking application, Pukka, enjoys a fair amount of AppleScript popularity for integrating with organizational apps such as Yojimbo and DevonThink and I'm hoping that the next release of Meerkat, which adds AppleScript support to that app as well, will fare similarly as it too can be a workflow-oriented application. The lesson of scriptability is one that I have taken to heart and I hope to maintain a high level of scripting support in all of my current and future applications.

Trackback URL for this post:

http://codesorcery.net/trackback/210

Cool solution!

It might also interest you to know that FastScripts has a light-weight growl-like display system. For instance, try:


tell application "FastScripts"
display message "Phew! We got it done!" at screen position top right
end tell

If you've already got Growl you might as well use it, but for users who are running lean, it can be quite helpful. It also supports some nice "autodismissing" options that make it suitable for very fleeting updates.

Daniel

Thanks, Daniel -- I saw

Thanks, Daniel -- I saw mention of that but hadn't looked into it.