• 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: applescript-users digest, Vol 2 #802 - 17 msgs
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: applescript-users digest, Vol 2 #802 - 17 msgs


  • Subject: Re: applescript-users digest, Vol 2 #802 - 17 msgs
  • From: "Tim Fink" <email@hidden>
  • Date: Mon, 25 Jun 2001 14:13:29 -0500

Dear Strange,

If your first list is not extensive, only a few items, then why not just
have them in the choice dialog as buttons themselves?

If it works for you, it may go something like this:


tell application "Finder"
set theFirstList to {"ItemOne", "ItemTwo", "ItemThree"}
set theSecondList to {"The first name is great", "The second item
is
unoriginal", "This is silly."}
display dialog "Get the description of which one?" buttons
{"ItemOne", "ItemTwo", "ItemThree"}
set yourDesc to the button returned of result --will be a text
string of the list item
set repeatSteps to the count of items of theFirstList --this counts
the list items to check
try
repeat with i from 1 to repeatSteps
set thisCheck to item i of theFirstList
if thisCheck contains yourDesc then
set thisDesc to item i of theSecondList as
string
end if
end repeat
on error
display dialog "There is no description for this item!
Sorry."
end try
display dialog thisDesc
end tell

I know this is a repeat counter, but it may save you an otherwise clumsy
dialog getting the user to return an asnwer as an integer.

good luck,

tim


  • Follow-Ups:
    • scripting bbedit
      • From: "Arthur Cormack" <email@hidden>
    • Why did I want the index of a list
      • From: "Greg Strange" <email@hidden>
  • Prev by Date: Re: How to script PowerPoint
  • Next by Date: Re: finder under 10
  • Previous by thread: Re: How to script PowerPoint
  • Next by thread: Why did I want the index of a list
  • Index(es):
    • Date
    • Thread