RE: Mutiple if and then for one value
RE: Mutiple if and then for one value
- Subject: RE: Mutiple if and then for one value
- From: "Grimm, Kenneth" <email@hidden>
- Date: Wed, 23 Feb 2005 17:17:29 -0500
Wow -- one I can answer. Finally.
> ----------
> From:
> applescript-users-bounces+grimmk=email@hidden on
> behalf of francois.houle
> Sent: Wednesday, February 23, 2005 3:08 PM
> To: email@hidden
> Subject: Mutiple if and then for one value
>
> How would I write a script where ideally I would have this:
>
> If this_value contains xx then display dialog "Please check this"
> If this_value contains yy then display dialog "Please check that"
>
> Etc...
>
>
If this_value contains xx then
display dialog "Please check this"
else
If this_value contains yy then
display dialog "Please check that"
end if
else
-- continue with conditions, etc.
end if
> So basically have mutiple "if" each with its own "then" for one value.
>
> Also would like to know if its possible, using only AppleScript, to have
> different actions happen depending on which byutton the user clicks in the
> display dialog... Or would I have to start learning how to work in Xcode
> to
> use studio... ?
>
>
set myResult to display dialog "Select a number" buttons {"One", "Two",
"Three"} default button 1 with icon note
set buttonAnswer to button returned of myResult
if buttonAnswer is "One" then
--do One stuff
else if buttonAnswer is "Two" then
--do Two stuff
else if buttonAnswer is "Three" then
--do Three stuff
end if
Ken
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden