Kevin
Kevin

Reputation: 1106

AppleScript : multiple condition

I need multiple condition to be true to run my script

set var1 to "variable 1 is here"
set var2 to "variable 2 is here"


if var1 = "variable 1 is here"  and var2 "variable 2 is here" then
    set var1 to "true"
end if

This is not working though, I guess AppleScript don't allow this.

I was thinking then to do something like this :

set score to 0
set var1 to "variable 1 is here"
set var2 to "variable 2 is here"

if var1 = "variable 1 is here" then
    set score to score + 1
end if

if var2 = "variable 2 is here" then
    set score to score + 1
end if

if score = 2 then
...

Is there anything simpler that this?

Upvotes: 0

Views: 685

Answers (1)

fuzzyCap
fuzzyCap

Reputation: 421

Your missing the = after the var2

if var1 = "variable 1 is here" and var2 = "variable 2 is here" then

Upvotes: 1

Related Questions