Control page button on/off

Posted on
Fri Oct 03, 2008 2:20 pm
risoam offline
Posts: 35
Joined: Sep 10, 2008

Control page button on/off

On my control page, I created a button to make a scene. The button has an indicator on it, green for "on" and red for "off". The button is linked to some applescript code. Is there a way on a control page if I press the button, meaning I am turning the scene on, it turns to green, and then press it again to red. I am looking for something similair with the device state buttons using the "+on" in the filename. THanks.

Posted on
Fri Oct 03, 2008 5:28 pm
matt (support) offline
Site Admin
User avatar
Posts: 21416
Joined: Jan 27, 2003
Location: Texas

Re: Control page button on/off

If you make the button inspect the state of an Indigo Variable (say "partyScene"), then you can use your AppleScript to toggle its state from true to false:
Code: Select all
   if value of variable "partyScene" is not "true" then
      set value of variable "partyScene" to "true"
   else
      set value of variable "partyScene" to "false"
   end if

Everytime that AppleScript is run it will toggle the state of the variable.

Regards,
Matt

Posted on
Fri Oct 03, 2008 7:54 pm
risoam offline
Posts: 35
Joined: Sep 10, 2008

(No subject)

I see, that would work. But, how can I make the image on the control page change for an on state and off state?

Posted on
Fri Oct 03, 2008 11:57 pm
matt (support) offline
Site Admin
User avatar
Posts: 21416
Joined: Jan 27, 2003
Location: Texas

(No subject)

risoam wrote:
I see, that would work. But, how can I make the image on the control page change for an on state and off state?

Inside the Control Page editor select the control element (or create a new one) and change its Display popup to Variable Value. Next, select the variable name from the For popup control and select the As image radio button and choose an image file.

Regards,
Matt

Posted on
Sat Oct 04, 2008 3:13 pm
risoam offline
Posts: 35
Joined: Sep 10, 2008

(No subject)

THanks Matt, I see how this works now. Works perfectly.

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 3 guests