Indigo / Applescript Tutorial?

Posted on
Sun Aug 17, 2008 9:29 pm
jaedendak offline
Posts: 29
Joined: Aug 15, 2008

Indigo / Applescript Tutorial?

Is there a tutorial anywhere that can help me get started with apple script and indigo? I'm looking for something specific to indigo. I've already found some tutorials for apple script in general, but I'm really only interested in use with indigo for now.

Posted on
Sun Aug 17, 2008 9:58 pm
matt (support) offline
Site Admin
User avatar
Posts: 21411
Joined: Jan 27, 2003
Location: Texas

Re: Indigo / Applescript Tutorial?

There isn't a specific tutorial I know of, but the sample scripts are a good place to start:
Code: Select all
/Library/Application Support/Perceptive Automation/Indigo 2/Scripts/

Additionally, our User Contribution Library has some great scripts. If there is anywhere in particular you get stuck, then let us know and I'm sure someone can help you out.

Regards,
Matt

Posted on
Sat Oct 10, 2015 7:56 pm
philipbasile offline
Posts: 113
Joined: Jan 08, 2015
Location: NJ

Re: Indigo / Applescript Tutorial?

Matt,

This applescript used to work fine I don't know whats changed but for some reason it displays the system message fine, so I know its running but then never logs to indigo. Do you see anything I'm doing wrong ?


on GoGoGeohop(email, subject)

tell application "System Events" to display dialog "Loc Event - " & subject & " " & time string of (current date)

tell application "IndigoServer"
log "Loc Event - " & subject & " " & time string of (current date)
end tell

end GoGoGeohop

Posted on
Sun Oct 11, 2015 4:58 pm
matt (support) offline
Site Admin
User avatar
Posts: 21411
Joined: Jan 27, 2003
Location: Texas

Re: Indigo / Applescript Tutorial?

I'm not sure, but if you move the dialog showing to after the tell IndigoServer block (after the end tell) does it still show up? And does it log to Indigo in that case?

Image

Posted on
Sun Oct 11, 2015 7:27 pm
philipbasile offline
Posts: 113
Joined: Jan 08, 2015
Location: NJ

Re: Indigo / Applescript Tutorial?

matt,

after further forum reading, am I running into the known applescript not talking to indigo bug ?

Philip

Posted on
Sat Apr 30, 2016 11:20 am
Different Computers offline
User avatar
Posts: 2533
Joined: Jan 02, 2016
Location: East Coast

Re: Indigo / Applescript Tutorial?

Maybe I'm missing the resource I need, but looking through the recommended sources above, I still don't find what I need.

The AS dictionary doesn't give me examples. (Ok, I can get, and there is device, but can I get the status of a device?

The included scripts are too high level and abstracted for what I need. They typically are iterating through self-generating lists of devices, not addressing a device.

I need an example that does something like this, which I'm sure is full of mistakes, but this would be my first guess on how to write the script:

Code: Select all
tell application "IndigoServer"
set output to status of device "Current Conditions:Forecast day 2"
end tell


I can't find the proper way to address "Forecast Day 2" when it's a subset of a device, and I can't figure out how to ask Indigo for the status once I know what thing to ask.

SmartThings refugee, so happy to be on Indigo. Monterey on a base M1 Mini w/Harmony Hub, Hue, DomoPad, Dynamic URL, Device Extensions, HomeKitLink, Grafana, Plex, uniFAP, Fantastic Weather, Nanoleaf, LED Simple Effects, Bond Home, Camect.

Posted on
Sat Apr 30, 2016 12:04 pm
matt (support) offline
Site Admin
User avatar
Posts: 21411
Joined: Jan 27, 2003
Location: Texas

Re: Indigo / Applescript Tutorial?

Custom plugin device information and states aren't available via AppleScript. We encourage using python scripting model going forward whenever possible.

Image

Posted on
Sat Apr 30, 2016 12:21 pm
RogueProeliator offline
User avatar
Posts: 2501
Joined: Nov 13, 2012
Location: Baton Rouge, LA

Re: Indigo / Applescript Tutorial?

I can't find the proper way to address "Forecast Day 2" when it's a subset of a device, and I can't figure out how to ask Indigo for the status once I know what thing to ask.

I believe others put a trigger on the change of the state and push that status to a variable, which is then exposed to the outside APIs. It is an extra step, but not terrible if you only need a few exposed like that.

Adam

Posted on
Sat Apr 30, 2016 1:01 pm
Different Computers offline
User avatar
Posts: 2533
Joined: Jan 02, 2016
Location: East Coast

Re: Indigo / Applescript Tutorial?

Thanks!

SmartThings refugee, so happy to be on Indigo. Monterey on a base M1 Mini w/Harmony Hub, Hue, DomoPad, Dynamic URL, Device Extensions, HomeKitLink, Grafana, Plex, uniFAP, Fantastic Weather, Nanoleaf, LED Simple Effects, Bond Home, Camect.

Posted on
Sat Apr 30, 2016 2:33 pm
Different Computers offline
User avatar
Posts: 2533
Joined: Jan 02, 2016
Location: East Coast

Re: Indigo / Applescript Tutorial?

Here's another puzzler.

Code: Select all
tell application "IndigoServer"
   set value of variable CamMotion to "true"
end tell


results in: error "The variable CamMotion is not defined." number -2753 from "CamMotion"

Except there the variable is in my Variable List. I tried referencing it by ID and that didn't work either.

SmartThings refugee, so happy to be on Indigo. Monterey on a base M1 Mini w/Harmony Hub, Hue, DomoPad, Dynamic URL, Device Extensions, HomeKitLink, Grafana, Plex, uniFAP, Fantastic Weather, Nanoleaf, LED Simple Effects, Bond Home, Camect.

Posted on
Sat Apr 30, 2016 2:35 pm
matt (support) offline
Site Admin
User avatar
Posts: 21411
Joined: Jan 27, 2003
Location: Texas

Re: Indigo / Applescript Tutorial?

Add quotes around CamMotion.

Image

Posted on
Sat Apr 30, 2016 2:57 pm
Different Computers offline
User avatar
Posts: 2533
Joined: Jan 02, 2016
Location: East Coast

Re: Indigo / Applescript Tutorial?

Gah!

Thank you!

SmartThings refugee, so happy to be on Indigo. Monterey on a base M1 Mini w/Harmony Hub, Hue, DomoPad, Dynamic URL, Device Extensions, HomeKitLink, Grafana, Plex, uniFAP, Fantastic Weather, Nanoleaf, LED Simple Effects, Bond Home, Camect.

Posted on
Sat Apr 30, 2016 5:28 pm
jay (support) offline
Site Admin
User avatar
Posts: 18199
Joined: Mar 19, 2008
Location: Austin, Texas

Re: Indigo / Applescript Tutorial?

I just want to reiterate here - Python is the future of scripting in Indigo. Unless you're specifically integrating other Mac apps into Indigo, I HIGHLY recommend learning Python. It's easy to learn, there are tons of tutorials, and the syntax is not nearly as random as AppleScript.

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 5 guests