• 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: "Mark J. Reed" <email@hidden>
  • Date: Thu, 16 Dec 2010 11:50:24 -0500

Did you try adding "as constant"?







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

  • Follow-Ups:
    • Re: How do you eval strings as enumerators in 10.6?
      • From: "email@hidden" <email@hidden>
    • Re: How do you eval strings as enumerators in 10.6?
      • From: David Jacopille <email@hidden>
References: 
 >How do you eval strings as enumerators in 10.6? (From: David Jacopille <email@hidden>)

  • Prev by Date: What Use Autofill
  • Next by Date: Re: What Use Autofill
  • Previous by thread: 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