Applescript Conversion

Posted on
Wed Jul 22, 2020 10:09 am
ckeyes888 offline
Posts: 2417
Joined: Nov 26, 2009
Location: Kalispell, MT

Applescript Conversion

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

Posted on
Wed Jul 22, 2020 10:22 am
FlyingDiver offline
User avatar
Posts: 7189
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: Applescript Conversion

It's just 'and'.

joe (aka FlyingDiver)
my plugins: http://forums.indigodomo.com/viewforum.php?f=177

Posted on
Wed Jul 22, 2020 6:42 pm
ckeyes888 offline
Posts: 2417
Joined: Nov 26, 2009
Location: Kalispell, MT

Re: Applescript Conversion

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

Posted on
Wed Jul 22, 2020 7:24 pm
FlyingDiver offline
User avatar
Posts: 7189
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: Applescript Conversion

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")

joe (aka FlyingDiver)
my plugins: http://forums.indigodomo.com/viewforum.php?f=177

Posted on
Wed Jul 22, 2020 7:59 pm
ckeyes888 offline
Posts: 2417
Joined: Nov 26, 2009
Location: Kalispell, MT

Re: Applescript Conversion

Doh, thought I tried that.

Thanks!

Carl

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 3 guests