Archive for the 'mac' Category

Offer: I’ll write a script for you

As part of working up Ruby Scripting for Leopard, I need to write piles of scripts. If you have a script you’d like to see written, drop me a line. It needs to be a script that controls applications in either /Applications or /System/Library/CoreServices. The application should be one that’s pre-installed or one that most everyone should install anyway (e.g., Quicksilver). You have to be running OS X 1.5 (Leopard).

Controlling iTunes with Ruby (alternate take)

Here’s a different version of the same playlist-generating script. This one uses rb-appscript rather than the built-in Scripting Bridge. (Raw source here.)

Controlling iTunes with Ruby

In working on Ruby Scripting Leopard, I’ve been helped by searching for AppleScript examples, such as those at Doug’s AppleScripts for iTunes. To pay it forward, I offer an example to some future searcher after the jump. Since WordPress (or something) is turning quotes into “smart” quotes, follow this link if you want plain text.

This should work on stock Leopard.

I run it via launchd, the replacement for cron(1). Lingon is a convenient way to create a launchd configuration file.

Soliciting reviewers and advice-givers

I’ve begun work in earnest on Ruby Scripting for Leopard. I’d like to assemble an audience who can review drafts and tell me what people like them need. I’ve set up a mailing list.

The one sentence description of the book is “How to do anything AppleScript can, but in Ruby.” That is, the main focus will be using Ruby to control other apps like Mail or Safari. It’ll also show you how to write code that makes use of Mac framework features (like sending Growl notifications and putting controllers for your scripts in the status bar). It won’t be your definitive guide to RubyCocoa, though. Most likely I won’t talk about Xcode or Interface Builder at all.

The book will assume no experience scripting Macs (or anything else). I’d like some helpers who fit that category, but also people with lots of experience.

Readers should know Ruby, but I haven’t decided how much. Certainly you needn’t be an expert. Anyone who knows Ruby to the level of my earlier Everyday Scripting with Ruby is definitely in the audience.