Re: Illustrator Scripting
Re: Illustrator Scripting
- Subject: Re: Illustrator Scripting
- From: Simon Topliss <email@hidden>
- Date: Fri, 11 Mar 2005 20:53:01 +0000
On 11 Mar 2005, at 7:37 pm, Steven Valenti wrote:
I need this to run in Adobe Illustrator 10. It compiles but errors on your "set x to..." line.
Adobe Illustrator 10 got an error: Can't make some data into the expected type.
Anything that would make a difference between versions?
There are 2 compound path items and 1 path item in a document. I need to move the compound path item that has the color Pantone 871 C to be in the back.
This fixes it.
tell application "Adobe Illustrator 10"
set x to path items of compound path items of layer 1 of document 1 whose name of spot of fill color of it is "PANTONE 871 C"
set movedItems to {}
repeat with i from 1 to x's length
set c to container of (item 1 of item i of x)
try -- nasty workaround to store a unique reference to the compound path item in the list of compound path items already moved (movedItems)
c as string -- will always error
on error m -- Can't make «class caCP» 1 of «class caLY» 1 of document 1 of application "Adobe Illustrator 10" into a string.
set cStr to m
end try
if cStr is not in movedItems then -- we haven't already moved the compound path item
move c to end of layer 1 of document 1
set end of movedItems to cStr
end if
end repeat
end tell
Not sure why AI10 creates a list of lists in the 'set x to..." line. It's been a while since a scripted v10.
Simon
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden