Where to get list of Indigo script verbs

Posted on
Mon Feb 16, 2004 10:51 pm
ddeppe offline
Posts: 23
Joined: Dec 13, 2003

Where to get list of Indigo script verbs

Hi - I've heard mention of a "dictionary" - where do I find it? I'd like to know how to check to see if it is day or night within the script, such as if day do this, else do that so that I could free up that conditional within the trigger event. I'm also wondering what the easiest way would be to keep track of total time a given device is on in a 24 hr period - for example the fish light should only be run a total of 2 hrs in any given day, so once it has been run for 2 hrs (in increments as small as 10 min's) it should be disabled until the next night. Any ideas for an easy way to script that? This is what I have so far (activated by motion detector with condition of during nighttime)

if (on state of device "Andrews Fish Light" is false) then
turn on "Andrews Fish Light" for 10 * 60
else
remove delayed actions for device "Andrews Fish Light"
turn off "Andrews Fish Light" in 10 * 60
end if

Also, if I upgrade to the latest beta to take advantage of the latest verbs, what precautions should I take to make sure I could go back to an earlier version if needed? Thanks.

end tell

Posted on
Tue Feb 17, 2004 7:59 am
matt (support) offline
Site Admin
User avatar
Posts: 21417
Joined: Jan 27, 2003
Location: Texas

Re: Where to get list of Indigo script verbs

ddeppe wrote:
Hi - I've heard mention of a "dictionary" - where do I find it?

From Apple's Script Editor application choose the "File->Open Dictionary..." menu item, then select Indigo from the list. For day or night just use the application property, "daylight." So you could say something like:

if daylight then
   log "it is daylight"
end if

ddeppe wrote:
I'm also wondering what the easiest way would be to keep track of total time a given device is on in a 24 hr period - for example the fish light should only be run a total of 2 hrs in any given day, so once it has been run for 2 hrs (in increments as small as 10 min's) it should be disabled until the next night. Any ideas for an easy way to script that?

You'll have to manually keep track, from within your script, of how long you've told the light to be on. I'd probably use an Indigo variable so that this information is saved along with the Indigo database when the application is quit or restarted. Once the variable hits your 2 hour threshold, you would need to disable your trigger. At some point you would then need to re-enable the trigger. You would probably want to create a Time/Date action that enables it every day at the same time. At this same time (use an Action Group so you can do them together) you'll want to reset the Indigo variable you used back to 0.

ddeppe wrote:
Also, if I upgrade to the latest beta to take advantage of the latest verbs, what precautions should I take to make sure I could go back to an earlier version if needed?

I've moved the beta over so it is now officially released. You shouldn't have any problems -- it is a relatively safe upgrade. There weren't any database file structure changes, so if you keep a copy of the old application you will still be able to use it. In general, I don't post betas unless I'm fairly confident they won't blow up anything. Of course I always encourge folks to back up all their data, especially their Indigo database file.

Regards,
Matt

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 30 guests