Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Applescript button returned of list

Hi


Here is my script:

set firstList to {"Sincronizza proprietà avanzate", "Escludi proprietà avanzate"}

set listchoice1 to choose from list firstList with prompt "Le proprietà avanzate di una cartella sono l'icona della cartella, la posizione degli elementii al suo interno e l'icona delle cartelle al suo interno." with title "Fai una selezione" without multiple selections allowed


At the end of the list there are two buttons, "Ok" and "Cancel", if I select "Ok" it goes ahed, if I select "Cancel" it still goes ahed.

Instead I want that if the button "Cancel" is selected, regardless of the choice made, the application must close.


How can I do that?

Posted on Jul 11, 2014 10:04 AM

Reply
Question marked as Best reply

Posted on Jul 11, 2014 10:22 AM

Returend result from choose from list


Result

If the user clicks the OK button, returns a

list
of the chosen
number
and/or
text
items; if empty selection is allowed and nothing is selected, returns an empty list (
{}
). If the user clicks the Cancel button, returns
false


So check to see if the result returned is false and if it is exit.


Something like (there are other ways to do this)


if listchoice1 is false then

tell me to quit

end

1 reply
Question marked as Best reply

Jul 11, 2014 10:22 AM in response to Matteo_999

Returend result from choose from list


Result

If the user clicks the OK button, returns a

list
of the chosen
number
and/or
text
items; if empty selection is allowed and nothing is selected, returns an empty list (
{}
). If the user clicks the Cancel button, returns
false


So check to see if the result returned is false and if it is exit.


Something like (there are other ways to do this)


if listchoice1 is false then

tell me to quit

end

Applescript button returned of list

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.