What’s this all about then?
rb-appscript is a powerful way to automate your Mac. It's similar to Applescript but it's built in Ruby, which means you get to leverage that language's powerful syntax and libraries. Giving you more time to make toasted sandwiches. You want long-winded explanations? We got those.
Please note that these scripts are by no means bulletproof, and are intended to provide examples of application scripting. I take no resposibility for any loss of data or mishaps; you download and run everything at your own risk. That said, I use all of these scripts in a production environment every day (well – more accurately, I use some of these scripts in a production environment most days).
Things: Procrastinate
As is often the case with application scripting, a large part of the challenge is wrapping your head around the app’s unique nomenclature – every program has its own cat-skinning inclination. I spent some time trying to “move” the selected items to the “scheduled” list, to no avail. However, thanks to the excellent AppleScript documentation provided by Cultured Code (available here), I eventually figured out that they had a special verb for me: schedule.
As usual, my preferred way of running all these scripts is with Red Sweater Software’s FastScripts, and attaching a dynamic, attractive keyboard shortcut to ‘em (historians may note that for this particular script I have chosen control-right arrow. My mnemonic: get away from me).
The source code is dozing amongst those fern fronds, just over there.
#!/usr/bin/env ruby -wKU require "rubygems" require 'appscript' require "date" things = Appscript.app('Things.app') tomorrow = DateTime.now.next_day things.selected_to_dos.get.each { |todo| things.schedule(todo, :for => tomorrow) }