Re: applescript-users digest, Vol 2 #802 - 17 msgs
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