if-else statements
if-else statements
- Subject: if-else statements
- From: iKel via AppleScript-Users <email@hidden>
- Date: Sun, 24 Nov 2019 13:00:29 -0600
Hi everyone,
I am trying to learn how if-else statements work in AppleScript. When I run the
script below I get "Expected end of line, etc. but found “else”.” It seems like
a simple script but I get this error and just really trying to learn the
mechanics of if-else statements in AS. I appreciate the help and insight!
set the dialog_result to ¬
(choose from list {1, 2, 3, 7} ¬
with title ("Pick the lucky number"))
if the dialog_result is {7} then display dialog ¬
"You win!" buttons {"OK"} default button {"OK"}
else
set the unluckyNumber to the dialog_result
display dialog the unluckyNumber & " is an unlucky number."
end if
Kind regards,
Kell
Logic is the foundation of the certainty of all the knowledge we acquire.
-Leonhard Euler
Kellen Ruyle
email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden