OK, I feel stupid asking this.... but I've been attempting to write my first trigger condition script for two days, without luck, and I'm down to just trying to get a simple 1 line script to execute. Eventually I'm trying to create a script in a Trigger Condition for the NOAA Weather+ so that I can parse the weatherAdvisory1Text for key words and execute different actions. However, I'm still trying to get a on-line script of anything running. In the questions below, you'll see I've tried applescript & Python, both inside the Indigo app and in the external development UIs - with zero luck. It's getting really frustrating, and I'd appreciate any help!
I'm running OS X 10.10.3 and Indigo-Pro 6.1.0. My Python is 3.4.3.
1. I am planning on putting my script inside a Trigger Condition. As there is no way to point to a file, I need to debug the code in either the AppleScript Editor or the Python IDLE, and then paste it into the trigger condition window, correct?
2. To start, I open the existing script 'example - list devices.scpt'. When I run it, I get:
'IndigoServer got an error: Application isn’t running." number -600'
but, the indigo server is running, and all of my other triggers & actions work fine, as do the web pages for the control pages.. Any ideas on what is wrong?
2. Second, I tried a simple a simple applescript In the trigger/condition script box, where I type the following text in and click 'compile and test':
'set onState to on state of device "693038355"
when the ID is from a leak detector device I have added. I get the error:
'can't get on state of device '693038355''
Any ideas, or other examples of how to run a one-line script?
3. Third, I tried a simple Python script in the trigger/condition script box:
'indigo.devices.len()'
but I get the error message:
'an unknown token can't go after this identifier' (where 'indigo' is highlighted')
any thoughts?
4. I've tried all kinds of simple scripts in the Python IDLE environment, and while straight Python runs fine, I can't figure out the code to connect to Indigo. Are there any complete examples of a Python file?
5. Finally, I read that custom states (such as NOAA W+) can NOT be accessed by AppleScript -true or false?
thanks in advance.