Enable/Disable schedule using an applescript

Posted on
Thu Sep 20, 2012 7:44 am
durosity offline
User avatar
Posts: 4320
Joined: May 10, 2012
Location: Newcastle Upon Tyne, Ye Ol' England.

Enable/Disable schedule using an applescript

Can’t seem to find a way to do this, trying to find a way of enabling a schedule when a script is run. I want to use it this way to allow me to toggle on/off schedules using a button on a control page, hence the extra bits in the script below about changing the values of the variables.. everything else works fine except the enabling/disabling of the schedule!

if value of variable "schedule1" is equal to "on" then
set value of variable "schedule" to "off"
disable schedule “heating on between 12:00am and 1:00am"
else
set value of variable "schedule1" to "on"
enable schedule "heating on between 12:00am and 1:00am"
end if

Any ideas?

Computer says no.

Posted on
Thu Sep 20, 2012 8:49 am
jay (support) offline
Site Admin
User avatar
Posts: 18220
Joined: Mar 19, 2008
Location: Austin, Texas

Re: Enable/Disable schedule using an applescript

The AppleScript terminology for schedules hasn't been updated since we change it from time/date actions before Indigo 5. So (according to the AppleScript dictionary for Indigo):

disable time date action “heating on between 12:00am and 1:00am"

and

enable time date action “heating on between 12:00am and 1:00am"

should work.

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Posted on
Thu Sep 20, 2012 9:53 am
durosity offline
User avatar
Posts: 4320
Joined: May 10, 2012
Location: Newcastle Upon Tyne, Ye Ol' England.

Re: Enable/Disable schedule using an applescript

Ahh that'd make sense.. i tried something similar to that but I missed the spaces between the date time section.

Computer says no.

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 4 guests