Script Away your Annoyances: Employing Automator in a Pinch

Occasionally I run into an annoyance that I can’t easily script – perhaps the application isn’t scriptable (because it’s GUI only), or because the means of scripting it is beyond my reach at the moment (I’m rarely in the mood to battle Applescript for more than 5 minutes).

automator-icon

A tool I like to turn to is OS X’s Automator. It comes on every Mac and, while not capable of everything, it is capable of clicking through a bunch of annoying menus. Here are two use cases for Automator.

h2. Image Manipulation in Preview

Snapping pictures of a whiteboard with your phone and then squirreling them away is an easy way to remember back to previous conversations. Often times I find the picture I’ve taken is way, way too big and contains a bunch of extra stuff I don’t need (like the markers sitting below the whiteboard, the projector screen above it, etc). Here’s what I like to do with whiteboard pictures:
# Open the image in Preview.
# Use the crop tool to select the region I want to retain.
# Press the crop button to crop the image.
# Go to the Tools menu and select Adjust Color.
# Click the Auto Levels button (which, anecdotally, works well enough for whiteboard pictures).
# Close the Adjust Color dialogue.
# Go to the Tools menu and select Adjust Size.
# Click the Fit Into picklist and change the size to 1280×1024.
# Click OK.
# Save the file and exit.

When faced with half a dozen images, all of this clicking gets annoying fast. This is where Automator becomes handy. I can launch Automator, select New Document, select Workflow, and then click Record. Now I can record steps 3 through 10 and save the workflow to my desktop.

Then, the next time I have an image, I open my Automator workflow, I open up the image, use the crop tool to select the crop region (since I certainly don’t expect a script to do that automatically), and then click the Run button in my Automator workflow. It dutifully goes through, opens all of the menus, and clicks all of the buttons. The next image goes quicker, since I don’t need to open Automator again. Woohoo! No more needless clicking for me.

h2. Anki Deck Shuffling

Speaking of being dutiful – every day, I spend about 30 minutes working through my “Anki”:http://ankisrs.net/ decks. I’m regularly creating new cards to support my habit, and I prefer to have new cards shown to me in random order (instead of in the order added). This is where Automator helps out.

ankismall1

According to the “Anki manual”:http://ankisrs.net/docs/manual.html#new-cards, using the random order option has an annoying limitation:

bq. One caveat with random order mode: if you review many of your new cards and then add more new cards, the newly added material is statistically more likely to appear than the previously remaining cards. To correct this, you can change the order to ordered mode and back again to force a re-sort.

To reshuffle an options group, I need to:
# Click the options button next to the name of a collection using the group.
# Click on the Order picklist.
# Select ‘Show new cards in order added.’
# Click OK.
# Click the same options button next to the same collection.
# Click on the Order picklist.
# Select ‘Show new cards in random order.’
# Click OK.

Yuck! To make matters worse, I need to do all of this again for the second options group. Thankfully, with Automator and the same recording process described earlier, I can double click a workflow on my desktop and it will take care of all the shuffling for me.

I hope you also find some great uses of Automator. It’s much, much more robust than simply recording a workflow, but I’ve found that’s the quickest way to approach it.
 

 
Conversation
  • shape says:

    thanks a lot for sharing this. i was specifically looking how to do Step 2 above “Use the crop tool to select the region I want to retain.” – Automator can’t seem to record or run this event. i try to record it, then when i hit run the cursor just stops at the location in the image i want to select. is it not able to do this? so i have to use QuickDropShot for this specific task?

  • Comments are closed.