How do you eval strings as enumerators in 10.6?
How do you eval strings as enumerators in 10.6?
- Subject: How do you eval strings as enumerators in 10.6?
- From: David Jacopille <email@hidden>
- Date: Thu, 16 Dec 2010 11:10:05 -0500
10.6 appears to have a problem evaluating strings using 'run script' that 10.4 and 10.5 did not have. The example is Illustrator, but, correct me if I'm wrong, this is a generic problem or difference with 10.6.
If I were to hard code what I want to do in the script it would look like this, which creates a new spot color swatch as expected:
tell application "Adobe Illustrator"
make new document
tell document 1 to make new spot with properties {name:"Light Yellow", color:{cyan:0, magenta:0, yellow:25, black:0}, color type: process color}
end tell
Note that the value of name is class 'text' and is in quotes, but the value of color type is not in quotes - it is an Adobe Illustrator enumeration.
But I don't want to hard code enumerated values in my script - I want my parameters to come from an XML file or database which means it has to be stored as a string. This simulates what I want to do:
set color_type to "process color"
tell application "Adobe Illustrator"
make new document
tell document 1 to make new spot with properties {name:"Light Yellow", color:{cyan:0, magenta:0, yellow:25, black:0}, color type:(run script color_type)}
end tell
Works great in 10.4 and 10.5. In 10.6 this results in "Adobe Illustrator got an error: An error of type -30002 has occurred."
Any ideas about how to evaluate strings to enumerators in 10.6?
_______________________________________________
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