• 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: How do you eval strings as enumerators in 10.6?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How do you eval strings as enumerators in 10.6?


  • Subject: Re: How do you eval strings as enumerators in 10.6?
  • From: "email@hidden" <email@hidden>
  • Date: Thu, 16 Dec 2010 09:37:12 -0800

I don't have illustrator at home and I have Tiger at work, so I can't test this, but:

Put this in your script upstream of the error.


tell application "Adobe Illustrator"
 if colorType is "process color" then
 set colorType to process color
 end if
 end tell

It should work, since the phrase process color is an application key word, this would change the string into the keyword.

Another option would be to use a script object to translate the string to the keyword.

HTH,

ES
 


On Thu, Dec 16, 2010 at 11:10 AM, David Jacopille <email@hidden> wrote:
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



--
Mark J. Reed <email@hidden>

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: 
 >How do you eval strings as enumerators in 10.6? (From: David Jacopille <email@hidden>)
 >Re: How do you eval strings as enumerators in 10.6? (From: "Mark J. Reed" <email@hidden>)

  • Prev by Date: Re: What Use Autofill
  • Next by Date: Re: What Use Autofill
  • Previous by thread: Re: How do you eval strings as enumerators in 10.6?
  • Next by thread: Re: How do you eval strings as enumerators in 10.6?
  • Index(es):
    • Date
    • Thread