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).
iTunes: Remember Position of Selected
This simple script takes your iTunes selection and sets the “bookmarkable” property to true, so it will remember where you’re up to (invaluable during War and Peace). It will also removed the “shufflable” flag, so that In Our Time from BBC Radio 4 won’t start playing at your next house party. Finally, it will set the genre to “podcast”, for no reason other than it seems more suitable than “grindcore”.
The source is available for your delectation.
#!/usr/bin/env ruby -w require 'appscript' app = Appscript.app('iTunes.app') app.selection.get.each do |p| app.set(p.bookmarkable, :to => true) app.set(p.shufflable, :to => false) app.set(p.genre, :to => "Podcast") end