photo credit: Axiraa via photopin cc

Use Applescript to change the artboard size in Illustrator

Actions in programs like Photoshop and Illustrator are great. But sometimes they’re just not enough. Like the other day when I was trying to figure a way to create an action to change the artboard size in Illustrator. Unfortunately, this is something that Illustrator can’t save in an Action.
Lucky for us, every Mac comes shipped with a powerful handy tool called ‘AppleScript’ that can come to the rescue in situations like this.

Everything can be a macro with Applescript

An action in Illustrator is nothing more than a recorded Macro that can be played over and over again. And a Macro is nothing more then a set of instructions passed to a program.
Now in AppleScript, you can ‘tell’ applications which keys are pressed. This gives us the great opportunity to create Macro’s for each and every program that we want. Like Illustrator for example: you are able to change the artboard size without using your mouse, just press Shift+O to select the artboard size tool, and press Enter to open a dialog.

Screenshot 2014-09-28 20.31.09
Now by pressing Tab and entering values we can change the artboard size any way we want, just by using our keyboard.

Create a macro to change the artboard size in Illustrator

Now we know this, we can simply use the verbose syntax of AppleScript to do our magic. In this example I’ll ‘tell’ Illustrator to change the height of the artboard to 39,5cm:

That’s it! You’ve now created an automation that Illustrators’ default action panel could not!

The possibilities are endless

The possibilities to pass a set of instructions to a program aren’t limited to Illustrator of course. In theory, any application on OSX can be ‘told what to do’ with AppleScript. This makes it a very useful and handy tool. Most software even has a specific documentation on how AppleScript can interact with them.
Although it’s language is a bit quirky, no doubt you’ll be the coolest kid in town once you show of your AppleScript skills to your co-workers.

Visitors give this article an average rating of 4.0 out of 5.

How would you rate this article?

Leave a Reply