Keynote: Add a Folder of PNGs to This Slide

keynoteWhat, you might ask yourself, is the point of this script? Can’t I just drag images into Keynote? Well, replies this hastily anthropomorphised bunch of code, you could do that. But your images will be strewn hither and thither, rather than nicely centered on your slide. Quod erat, as my uncle would say, demonstrandum.

Download Add-a-folder-of-PNGs-to-this-slide.rb.zip.

The source code is sleeping gently, just down there. Hush now, source code.

Read More »

Posted in keynote | Leave a comment

iTunes: Remember Position of Selected

itunesHave you ever downloaded something that wasn’t a podcast, but should behave like a podcast? You know, Russell Crowe reading the collected works of Tolstoy, that kind of thing.

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”.

Download Remember-position-of-selected.rb.zip

The source is available for your delectation.

Read More »

Posted in itunes | Leave a comment

Illustrator: Turn Off Artboard Junk

illustratorIllustrator CS4 has artboards. All well and good. However, the amount of information that these things are festooned with defies belief – it’s like being in the cockpit of a Stealth Bomber. OK I’m exaggerating (slightly) but this script kills the cross hairs, safe areas, and center markers on all your artboards, in one fell swoop.

Here’s a demonstration. Double click for full screen – if you dare.

Download Turn-off-artboard-junk.rb.zip

Source code follows.

Read More »

Posted in illustrator | Leave a comment

Illustrator: Save Copy as AI3

illustratorSave the frontmost document as an Illustrator 3 file. Handy for programs that import Illustrator, but don’t recognise the latest versions (such as Cinema 4D).

Download Save-copy-as-AI3.rb.zip

The source code is available for your perusal below.
Read More »

Posted in illustrator | Leave a comment

Illustrator: Merge Selected Text

illustratorOften, when opening a PDF in Illustrator, the text is split into a whole bunch of discrete chunks. This will (hopefully) speed up merging them back together. Just select the text and run the script. Bingo!

Download Merge-selected-text.rb.zip.

The source code is licking its wounds below.
Read More »

Posted in illustrator | Leave a comment

Illustrator: Renumber Artboards

illustratorRenumber artboards from left to right, top to bottom. Handy when you’re creating a storyboard and need to add or delete frames.

Here’s a demonstration. Double click it for full screen – if you’re man enough.

Download Renumber-artboards.rb.zip.

Source code, after the jump. Stay tuned!

Read More »

Posted in illustrator | 6 Comments

Mail: Save Selected Emails as Text Files

mailThis little baby asks your for a destination, then loops through every email you’ve got selected and attempts to save it there as a text file. Why you can’t just drag your emails into a folder is quite beyond me.

Download Save-selected-emails-as-text-files.rb.zip.

The source code is chuckling quietly to itself, just over there.

Read More »

Posted in mail | Leave a comment

Mail: Save Attachments

mailLoops through every selected email and attempts to save its attachments to a folder of your choosing. Handy for when people send you a gazillion emails with one attachment each. Incidentally, I can’t believe this command isn’t built-in to Mail.app …

Download  Save attachments.zip.

Source code, just south of here. Read More »

Posted in mail | 4 Comments

Rb-Appscript Resources

Here are a few links to help you wrap your head around rb-appscript. If you’ve got any more you’d like to share, go ahead and email me.

rb-appscript home
This is rb-appscript HQ, where Hamish Sanderson pops the hood and performs inexplicable miracles with Apple Events.
Scripting Mac Applications With Ruby: An AppleScript Alternative.
Matt Neuberg’s very comprehensive introduction to rb-appscript.
dot unplanned
Mike Hall performs all manner of wondrous feats using nothing other than rb-appscript and some chewing gum.
Posted in learning | Leave a comment

Illustrator: Fit Artboard to Artwork

illustratorThis fits the first artboard to the geometric bounds of all the page items in your document. Unfortunately I can’t get it to just shrink one artboard to its contents; the geometric bounds apply to every page item on every artboard. Still, better than getting a splinter under your fingernail.

Download Fit artboard to artwork.rb.

Source code after the jump.

Read More »

Posted in illustrator | 12 Comments
  • 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).