The clue is in the title. This is especially handy when you attach a keyboard shortcut with a utility such as – the frankly indispensable – FastScripts.
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)
2 Comments
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_”
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.