Spinning Electrons

(the blog at botmanfamily.net)

Archive for the ‘software’ Category

Using AppleScript to prevent burnt dinners

without comments

Problem: After the initial “put pan on stove, turn heat on”,  the next procedural step in dinner preparation typically tends to be “wait 3-4 minutes”, at which point I wander over to the computer, with the intention of reading just one or two short entries from my RSS feed reader, and end up waking up from my internet browsing 15 minutes later to the smell of burning food on the stove.

So I found the post “Create a simple timer using LaunchBar and AppleScript” by Justin Blanton. However, that approach uses both AppleScript and LaunchBar. I don’t have LaunchBar (or QuickSilver, or QSB) installed, and installing it just for this trivial task seemed overkill. I reasoned that a solution could equally well be built on top of Growl + AppleScript, without the need for LaunchBar.

So here’s my AppleScript+Growl solution. It’s a bit rough around the edges, assumes you already have Growl installed, does no error checking, etc.. Use at your own peril.

set message to ""
tell application "Finder"
 display dialog "Enter the delay in minutes:"
     default answer "" buttons {"OK"} default button 1
 set howlong to text returned of the result
 set duration to howlong * 60
 display dialog "Enter the message:" default answer ""
     buttons {"OK"} default button 1
 set message to text returned of the result
end tell
tell application "GrowlHelperApp"
 set the allNotificationsList to {"Delay Notification"}
 set the enabledNotificationsList to
     {"Delay Notification"}
 register as application "DelayNotify" all notifications
     allNotificationsList default notifications
     enabledNotificationsList icon of application "iCal"
 delay duration
 notify with name "Delay Notification" title
    "Notification" description message application name
    "DelayNotify" with sticky
end tell

 

Using the “Save As… Application” option you can build an Application which sits on your desktop. Double-click this for each timer you want to set. Less elegant than just typing the command into LaunchBar, for sure, but equally functional, at least for my purposes.

Written by aurelien

March 2nd, 2010 at 8:41 pm

Posted in software

iWork '09 tip

without comments

This has annoyed me for so long and until recently I was not able to find the solution anywhere online, that’s why I’m posting this here.

If you make a document with Pages ’09, and you have images (or other media) in the document, and you want to save the image, it is not immediately obvious how to do this.  This is because inexplicably and contrary to most of the rest of Mac OS X, you cannot just drag the media out from the document into Finder. I.e., drag and drop out of a Pages / Keynote document is not supported.

However there is a workaround!  Click the media, go to the inspector, go to the metrics tab (ruler icon), click on the object’s icon under “file info”, and drag that out of the document into Finder.

Thanks to “RobR” for pointing this out: original link.

(Actually there is another workaround: one could in theory rename the document filename to .zip extension, unzip it, open the package with Finder, navigate to the images folder, try to recognise which file you want, and drag it out into Finder — but I’m discounting this because it’s tedious and you need to close the document before doing this.)

Written by aurelien

July 23rd, 2009 at 4:43 pm

Posted in software

First post

without comments

Greetings! This is a first post to test that the blog is working correctly.

Written by aurelien

February 4th, 2009 at 9:45 pm

Posted in software