[ANSWERED]Change the time of a schedule with Applescript

Posted on
Wed Nov 18, 2015 5:58 am
pauerbuk offline
Posts: 17
Joined: Jan 29, 2013

[ANSWERED]Change the time of a schedule with Applescript

Hello to all!
I would like to know if there is a way to change the time of a schedule with Applescript. Does anyone know if it is possible?
Thank you in advance

Mac mini 2,4 Ghz Intel Core 2 Duo - El Captain 10.11.1

Posted on
Wed Nov 18, 2015 9:57 am
jay (support) offline
Site Admin
User avatar
Posts: 18216
Joined: Mar 19, 2008
Location: Austin, Texas

Re: Change the time of a schedule with Applescript

You can change the schedule's definition. How to do it, however, depends on how the schedule is currently defined. Check out the time date section of the AppleScript dictionary for details - you'll probably want to set the absolute trigger time if the schedule runs at a fixed time or countdown delta if it has a recurring time element.

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Posted on
Fri Nov 20, 2015 1:38 pm
pauerbuk offline
Posts: 17
Joined: Jan 29, 2013

Re: [ANSWERED]Change the time of a schedule with Applescript

Thanks Jay, the idea was to be able to change the time of starting the heater in the web control page.
The schedule runs every day, but I would like to change the start time, if there were days colder than others.
What is the syntax to update the time of the existing schedule?
Thanks again, and hello
Piero

Mac mini 2,4 Ghz Intel Core 2 Duo - El Captain 10.11.1

Posted on
Sat Nov 21, 2015 11:28 am
jay (support) offline
Site Admin
User avatar
Posts: 18216
Joined: Mar 19, 2008
Location: Austin, Texas

Re: [ANSWERED]Change the time of a schedule with Applescript

Here's one way - it takes the next schedule time from your schedule, changes the hours (24-hour clock) and minutes, then sets the next schedule time to the new time:

Code: Select all
tell application "IndigoServer"
   set currentTime to absolute trigger time of time date action named "Name of Your Schedule Here"
   set hours of currentTime to 22
   set minutes of currentTime to 30
   set absolute trigger time of time date action named "Name of Your Schedule Here" to currentTime
end tell

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Posted on
Tue Nov 24, 2015 9:00 am
pauerbuk offline
Posts: 17
Joined: Jan 29, 2013

Re: [ANSWERED]Change the time of a schedule with Applescript

Thanks Jay! This resolved my problem! :P
Have a nice day!

Piero

Mac mini 2,4 Ghz Intel Core 2 Duo - El Captain 10.11.1

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 6 guests

cron