• 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: Still trying to learn list subtleties
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Still trying to learn list subtleties


  • Subject: Re: Still trying to learn list subtleties
  • From: Robert Poland <email@hidden>
  • Date: Sat, 26 May 2012 21:19:26 -0600

Thanks Chris,

Here's the script as I see it;

Don't see how this accesses the "Choose Color" command.

set lookupTable to "
Black     {\"0\", \"0\", \"0\"}
BlueGray  {\"8000\", \"8000\", \"10000\"}
Red       {\"65535\", \"0\", \"0\"}
White     {\"65535\", \"65535\", \"65535\"}
Manual    \"Choose Color\"
"
set theColorList to find text "^\\w+" in lookupTable with regexp, string result and all occurrences without case sensitive
set theColor to (choose from list theColorList default items (item 2 of theColorList))
if theColor is not false then
set theColor to item 1 of theColor
set colorRef to run script (find text "^" & theColor & "\\s+(.+)" in lookupTable using "\\1" with regexp and string result without case sensitive)
else
return
end if

tell application "GraphicConverter"
activate
show tools
delay 0.2
tell window 1 -- Tools window
set background color to colorRef
delay 0.4 -- need time
end tell
-- tell window 1 to change margins with {leftMargin, topMargin, rightMargin, bottomMargin}
beep
end tell



On May 26, 2012, at 6:20 PM, Christopher Stone wrote:

set lookupTable to "
Black     {\"0\", \"0\", \"0\"}
BlueGray  {\"8000\", \"8000\", \"10000\"}
Red       {\"65535\", \"0\", \"0\"}
White     {\"65535\", \"65535\", \"65535\"}
Manual    \"Choose Color\"
"
set theColorList to find text "^\\w+" in lookupTable with regexp, string result and all occurrences without case sensitive
set theColor to (choose from list theColorList default items (item 2 of theColorList))
if theColor is not false then
set theColor to item 1 of theColor
set colorRef to run script (find text "^" & theColor & "\\s+(.+)" in lookupTable using "\\1" with regexp and string result without case sensitive)
end if


Robert Poland - Fort Collins, CO



 _______________________________________________
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: Still trying to learn list subtleties
      • From: Christopher Stone <email@hidden>
References: 
 >Still trying to learn list subtleties (From: Robert Poland <email@hidden>)
 >Re: Still trying to learn list subtleties (From: Christopher Stone <email@hidden>)

  • Prev by Date: Re: Still trying to learn list subtleties
  • Next by Date: Re: Still trying to learn list subtleties
  • Previous by thread: Re: Still trying to learn list subtleties
  • Next by thread: Re: Still trying to learn list subtleties
  • Index(es):
    • Date
    • Thread