• 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: Christopher Stone <email@hidden>
  • Date: Sat, 26 May 2012 19:20:15 -0500

On May 26, 2012, at 12:01, Robert Poland wrote:
Looking for busy work…
______________________________________________________________________

Hey Bob,

This is probably how I'd go about it using the Satimage.osax:

------------------------------------------------------------------------------------------------
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
------------------------------------------------------------------------------------------------

Doing it this way I only have to maintain the table.

--
Best Regards,
Chris

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

  • Prev by Date: Re: AppleScript-Users Digest, Vol 9, Issue 180
  • 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