Applescript crashing Adobe Illustrator
Applescript crashing Adobe Illustrator
- Subject: Applescript crashing Adobe Illustrator
- From: Jim Skibbie <email@hidden>
- Date: Wed, 05 May 2010 14:13:09 -0500
- Thread-topic: Applescript crashing Adobe Illustrator
Title: Applescript crashing Adobe Illustrator
I’m working on an Applescript for Adobe Illustrator. When the script runs, it causes Illustrator to crash with the error:
Adobe Illustrator got an error: Connection is invalid. Error –609.
Here’s the portion of the script that causes the crash. This code works for some files and for other files, it crashes Illustrator.
Any ideas?
set LayersToSave to {"Names", "Of", "Specific", "Layers"}
tell application "Adobe Illustrator"
set AIDoc to current document
set theLayers to every layer of AIDoc
end tell
repeat with j from (count of theLayers) to 1 by -1
set theName to name of item j of theLayers
if LayersToSave does not contain theName then my RemoveThisLayerFromFile(theName, AIDoc)
end repeat
on RemoveThisLayerFromFile(LayerName, doc)
tell application "Adobe Illustrator"
if (exists layer LayerName of doc) then
delete layer LayerName of doc
end if
end tell
end RemoveThisLayerFromFile
Thanks.
Jim
_______________________________________________
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