Illustrator: All Layers Visible

illustratorThe clue is in the title. This is especially handy when you attach a keyboard shortcut with a utility such as – the frankly indispensableFastScripts.

Download All-layers-visible.rb.zip.

The source code is sheltering from a brief sun shower below.

#!/usr/bin/ruby

# rb-appscript code by Ian Haigh : http://ianhaigh.com/
# Fri Dec  4 11:21:53 EST 2009

require "rubygems"
require 'appscript'

Appscript.app('Adobe Illustrator.app').current_document.layers.visible.set(true)
This entry was posted in illustrator. Bookmark the permalink. Trackbacks are closed, but you can post a comment.

2 Comments

  1. Steve
    Posted December 30, 2009 at 9:04 am | Permalink

    I cannot for the life of me figure out how to set the fill color of a paragraph.

    fillRed = {:class_ => :CMYK_color_info, :black => 0.0, :cyan => 0.0, :magenta => 100, :yellow => 100}

    illustrator.layers[1].text_frames[1].text.paragraph[1].word[1].fill_color.set(fillRed)
    I just get an error ” Unknown keyword parameter: :class_”

  2. Posted December 30, 2009 at 10:22 am | Permalink

    Hey Steve, I tried it out and get the same result. I suspect it’s the way rb-appscript is constructing the Apple Event; I have it working with no problem in Applescript. This might be one for the mailing list.

Post a Comment

Your email is never published nor shared. Required fields are marked *

*
*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

  • 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).