[ANSWERED]Enable Time/Date action in the future

Posted on
Tue Dec 30, 2014 2:39 am
SMUSEBY offline
Posts: 119
Joined: Sep 16, 2009

[ANSWERED]Enable Time/Date action in the future

I would like to enable a time/date action in "n" days. Below is my failed attempt to enable an absolute event for today. Neither "dt" or "the AS "current date" are acceptable to the Indigo AS Command "absolute trigger time to date "xxx"". Beyond that, I am unable to perform date math to add, say, 3 days to today. Is it possible to schedule an event for the future with AS? Is there a better alternative?

set dt to do shell script "/bin/date \"+%D, %H:%M\""
tell application "IndigoServer"
enable time date action "XYZ"
tell time date action "XYZ"
set date trigger type to absolute
set absolute trigger time to date dt --(also tried current date)
end tell
end tell

Posted on
Tue Dec 30, 2014 10:18 am
jay (support) offline
Site Admin
User avatar
Posts: 15693
Joined: Mar 19, 2008
Location: Austin, Texas

Re: Enable Time/Date action in the future

This will set it to the current date/time:

Code: Select all
tell application "IndigoServer"
    # Add 3 days to the current date. The add operator expects seconds so multiply it out.
    set nextExecutionTime to current date + (3 * (60 * 60 * 24))
    # Set the trigger time to that value
    set absolute trigger time of time date action "XYZ" to nextExecutionTime
end tell

Note, however, that you're not actually enabling/disabling the schedule but rather just changing when it will run. I don't know what your exact need is but actually enabling/disabling the schedule might be a better option.

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 0 guests