[ANSWERED]: Variable List Empty

Posted on
Sat Sep 20, 2014 1:20 am
rm2014 offline
Posts: 28
Joined: Sep 14, 2014

[ANSWERED]: Variable List Empty

From the documentation - it says Indigo ships with scripts that include variables? However my list of variables are totally empty?

How do I get that list of variables populated?

Posted on
Sat Sep 20, 2014 7:59 am
kw123 offline
User avatar
Posts: 8360
Joined: May 12, 2013
Location: Dallas, TX

Re: Variable List Empty

I believe it is like this: There are scripts that can create variables.
the scripts that come with indigo are in /Library/Application Support/Perceptive Automation/Indigo 6/Scripts and then in /attachements and in /attachments (disabled) .
they are applescripts
But that does not really help you.

you can create your own variables and use them in scripts or in triggers

best way to get started is do you a very simple script in an ACTION in an ACTION GROUP

here an applescript example where I use some variables and device informations;
Code: Select all
tell application "IndigoServer"
   set frontDoor to on state of (device named "doorStatusFront")
   set kitchenDoor to on state of (device named "doorStatusKitchen")
   set poolDoor to on state of (device named "doorStatusPool")
   set backDoor to on state of (device named "doorStatusBack")
   set doorsTryCount to value of variable ("doorsTryCount")
   
end tell
if doorsTryCount > 4 then
   tell application "IndigoServer"
      set value of variable "doorsTryCount" to "0"
   end tell
else
   if (frontDoor and kitchenDoor and poolDoor and backDoor) then
      tell application "IndigoServer"
         set value of variable "doorsTryCount" to "0"
      end tell
      return
   else
      tell application "IndigoServer"
         execute group "lockDoors"
      end tell
   end if
end if



and here how to use / set a variable (the first line) in a trigger for further actions / triggers in the script above.
Attachments
Screen Shot 2014-09-20 at 8.57.24 AM.png
Screen Shot 2014-09-20 at 8.57.24 AM.png (51.25 KiB) Viewed 2485 times

Posted on
Tue Oct 21, 2014 2:43 pm
rm2014 offline
Posts: 28
Joined: Sep 14, 2014

Re: Variable List Empty

Hi Karl - never got to thank you for all the help here. This along with your excellent Fing plugin really helped me to understand the whole variable world. I have Fing now setup and understand variables now. I see what you mean now when you said the steep learning curve, but its all starting to make sense now :)

Cheers
Ross

Posted on
Tue Oct 21, 2014 8:13 pm
kw123 offline
User avatar
Posts: 8360
Joined: May 12, 2013
Location: Dallas, TX

Re: [ANSWERED]: Variable List Empty

Ross
you are welcome... I started about 18 months ago with my first little apple script. Nw my biggest plugin has 7000 lines.. real experts probably could do it with 100..
Karl

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 1 guest