New to Applescript

Posted on
Mon Mar 04, 2013 10:51 am
BaldDaddy offline
User avatar
Posts: 21
Joined: Feb 15, 2013

New to Applescript

Good morning,

New to Indigo and Applescript and was hoping that someone could help me with this basic task so I can begin to get a handle on scripting within Indigo.

I want Indigo to interrogate a particular device, in this case a garage door, to determine if it is closed using an IF...THEN. Being an I/O Linc with Sensor I don't think that I am able to just issue a close command, as it only serves as a toggle switch. In Indigo, I know I can programmatically do it using a trigger (as seen below) but I wish to create a "Good Night" Script that will reach out to all the devices in my house and turn off/lock/close/etc and seems a script would be the easiest way to accomplish this.

The trigger I have set up for this first simple task, the one I wish to convert to AppleScript is as follows: Trigger: "SMS" receivedText becomes equal to GoodNight, Condition: If Garage 1 binaryInput is false, Action: turn on Garage 1 output 1.

Many Thanks!

Eric

Posted on
Mon Mar 04, 2013 7:54 pm
matt (support) offline
Site Admin
User avatar
Posts: 21417
Joined: Jan 27, 2003
Location: Texas

Re: New to Applescript

Hi Eric,

I believe the script snippet below would handle the conditional and action (untested):

Code: Select all
tell application "IndigoServer"
   set ioLincName to "Your I/O-Linc Name Here"
   set firstBinaryInput to item 1 of (get binary inputs of device ioLincName)
   if firstBinaryInput is false then
      set binary outputs of device ioLincName to {true}
   end if
end tell

Image

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 24 guests