• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Illustrator CS5.1 color conversion
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Illustrator CS5.1 color conversion


  • Subject: Re: Illustrator CS5.1 color conversion
  • From: Brian Christmas <email@hidden>
  • Date: Wed, 21 Nov 2012 13:52:15 +1100

G'day again

Last script, I promise!

The last one crashed on invisible layers, and locked layers. This fixes those problems.

As well, i've recorded  the properties of each item. You might want to use some properties, such as filled = true, to selectively process which items are greyscaled.

Regards

Santa

tell application "Adobe Illustrator"
activate
tell current document
set theCount to (count of layers) as text
set theProperties to {}
set theProps to {}
repeat with EachLayer from 1 to theCount
if EachLayer > 1 and EachLayer < theCount then
if visible of layer EachLayer = true then # if invisible layer existed, script would have crashed.
set locked of layer EachLayer to false # if you don't want to process locked layers, you might want an if statement here instead, such as... 
# if not (locked of layer EachLayer) then
set theProperties to page items of layer EachLayer
repeat with EachItem from 1 to count of theProperties
set selection to item EachItem of page items of layer EachLayer
set end of theProps to properties of selection
set end of theProps to return & return & return
tell application "System Events" to tell process "Illustrator"
try
click menu item "Convert to Grayscale" of menu 1 of menu item "Edit Colors" of menu 1 of menu bar item "Edit" of menu bar 1
end try
end tell
end repeat
set theProperties to text frames of layer EachLayer
repeat with EachItem from 1 to count of theProperties
set selection to text range of item EachItem of text frames of layer EachLayer
set end of theProps to properties of item EachItem of text frames of layer EachLayer
set end of theProps to return & return & return
tell application "System Events" to tell process "Illustrator"
try
click menu item "Convert to Grayscale" of menu 1 of menu item "Edit Colors" of menu 1 of menu bar item "Edit" of menu bar 1
end try
end tell
end repeat
# end if # if not locked
end if
end if
end repeat
end tell
end tell
theProps
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden

References: 
 >Re: Illustrator CS5.1 color conversion (From: "Houston, Brad" <email@hidden>)

  • Prev by Date: Re: Illustrator CS5.1 color conversion
  • Next by Date: Re: need help with progress bar please.
  • Previous by thread: Re: Illustrator CS5.1 color conversion
  • Next by thread: Re: Setting cell styles
  • Index(es):
    • Date
    • Thread