Applescript commands to Indigo

Posted on
Mon May 26, 2014 10:28 am
Vangelis offline
Posts: 167
Joined: Mar 18, 2014
Location: Southampton (UK)

Applescript commands to Indigo

Point 1, I am not a programmer - Took me a while to find the AppleScript Editor on my Mac (just to set the scene)

I am trying to create an Action within Indigo that does something e.g. Speaks, when an AppleScript is run (outside of Indigo) - In this case using Event Script, when it detects my Bluetooth Phone.

An example script is...

on run eventArgs

-- Let's check we're being triggered by the correct event

if (trigger of eventArgs is "iTunes track changed") then

-- Not very original :-)

tell application "iChat"
set status message to "Listening to: " & (track of eventArgs as string) & " by " & (artist of eventArgs as string)
end tell

end if

end run

However I haven;t a clue where to tell it that it has to engage with Indigo (suspect its the 'tell application' bit, or what the syntax would be e.g. 'Indigo Server'?

Everything runs on one mac mini i.e Indigo, Event Script etc. I have looked at the IndigoServer.app Terminology page and also some of the User contributions and example scripts, but am still lost.

I know one user had this working so any help would be appreciated.

Vangelis

Posted on
Mon May 26, 2014 11:55 am
autolog offline
Posts: 3991
Joined: Sep 10, 2013
Location: West Sussex, UK [GMT aka UTC]

Re: Applescript commands to Indigo

Vangelis wrote:
... I know one user had this working so any help would be appreciated. ...

Maybe this will help? Completing Common Tasks in AppleScript :)

Posted on
Wed Jun 18, 2014 1:18 am
thomasw offline
Posts: 135
Joined: Feb 13, 2011

Re: Applescript Trigger?

Hi Guys,
I have read through here and still can't get this correct. I need to have a Trigger (with an Applescript) that delays 60 sec BEFORE it checks to see the on/off state of an appliance linc and a variable.
If both the appliance linc is "on" and the variable is "true", THEN, I need the Trigger to do the action, which is to send EZI/O40 LInc output 3 "on". If either the appliance linc is "off"
or the variable is "false" then I do NOT want the trigger to do the action. I know the Trigger has a delay checkbox, but that won't work for this. (it simply checks the device state and variable state immediately, and then delays 60 seconds before doing the action) I need the Trigger to delay BEFORE it
checks for the state of the appliance linc and the variable. I tried to just create a new Trigger and leaving the "if conditions match rules" blank, and checking the bottom "if script returns true" box. I tried to put in
delay 60
if ((value of variable "Testname" = "true") and (device "AppLincName" = "on")) then execute

and this won't work.
I thought of using a Trigger that goes off when the Door Switch sends "on", and then have the Trigger delay 60 sec and then run an Action Group to do the EZI/O40 output 3 "on", IF the appliance linc state is "on" and the variable is "true", but I can't setup the Action Group that way? There is no way other than an Applescript to do a 60 delay FIRST, then check the appliance linc state and variable state, and then do the action of sending EZI/O40 output 3 "on".
I even thought of having 2 Triggers, with the first controlling the second one. But that didn't work either.
Summary of need: Door Switch (ToggleLinc) sends "on" to Indigo. Indigo delay 60 seconds. Indigo check appLinc on/off, check variable true/false. IF on+true, THEN Indigo send EZI/O40 output 3 "on". (if appLinc is "off" or variable is "false" then Indigo do NOTHING.
Hope this is clear enough? Thanks

Posted on
Thu Jun 19, 2014 5:29 pm
thomasw offline
Posts: 135
Joined: Feb 13, 2011

Re: Applescript commands to Indigo

Hi All,
I have solved my problem for this. For details, see my other post about Action Group Settings. I ended up just having the Trigger wait 60 seconds, THEN execute an Action Group 1, which runs an applescript to check a variable, and then execute either Action Group 2 or Action Group 3, based upon the variable being "true" or "false".
-Tom

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 21 guests