• 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: Mutiple if and then for one value
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Mutiple if and then for one value


  • Subject: Re: Mutiple if and then for one value
  • From: "francois.houle" <email@hidden>
  • Date: Thu, 24 Feb 2005 13:42:12 -0500

I've found an even more legant way to deal with my second request...

display dialog "bla bla bla" with icon 2 buttons {"No", "Yes"} default
button 2
    if button returned of result is "Yes" then

Short isn't it ?

On 2/23/05 5:17 PM, "Grimm, Kenneth" <email@hidden> wrote:

> 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

References: 
 >RE: Mutiple if and then for one value (From: "Grimm, Kenneth" <email@hidden>)

  • Prev by Date: Re: shell script date
  • Next by Date: How do I get a script to ask me the number of times to repeat?
  • Previous by thread: RE: Mutiple if and then for one value
  • Next by thread: Ignore a script object or applet or what...?
  • Index(es):
    • Date
    • Thread