Page 1 of 1

Applescript Conversion

PostPosted: Wed Jul 22, 2020 10:09 am
by ckeyes888
Thought I had an example of a python script that uses an "and" but can't find it.
Appreciate any help converting this one to python.
Code: Select all
tell application "IndigoServer"
   if the value of variable "sprk_Test_All" is equal to "on" and the value of variable "sprinkler_season" is equal to "true" then
      execute group "Sprinkler - All Stop - Variables Set"
   else
      if the value of variable "sprk_Test_All" is equal to "off" and the value of variable "sprinkler_season" is equal to "true" then
         execute group "Sprinkler - 30 Sec Test All Areas"
      end if
   end if
end tell


Thanks,

Carl

Re: Applescript Conversion

PostPosted: Wed Jul 22, 2020 10:22 am
by FlyingDiver
It's just 'and'.

Re: Applescript Conversion

PostPosted: Wed Jul 22, 2020 6:42 pm
by ckeyes888
Tried this but won't compile.
Code: Select all
spkTestAll = indigo.variables[827222103]
spkSeason = indigo.variables[225043098]

if spkTestAll.value == "on":
   and spkSeason.value == "true":
    indigo.actionGroup.execute("Sprinkler - All Stop - Variables Set")
elif spkTestAll.value == "off":
   and spkSeason.value == "true":
    indigo.actionGroup.execute("Sprinkler - 30 Sec Test All Areas")


Appreciate any help with it.

Carl

Re: Applescript Conversion

PostPosted: Wed Jul 22, 2020 7:24 pm
by FlyingDiver
Code: Select all
spkTestAll = indigo.variables[827222103]
spkSeason = indigo.variables[225043098]

if spkTestAll.value == "on" and spkSeason.value == "true":
    indigo.actionGroup.execute("Sprinkler - All Stop - Variables Set")
elif spkTestAll.value == "off" and spkSeason.value == "true":
    indigo.actionGroup.execute("Sprinkler - 30 Sec Test All Areas")

Re: Applescript Conversion

PostPosted: Wed Jul 22, 2020 7:59 pm
by ckeyes888
Doh, thought I tried that.

Thanks!

Carl