First of many... Alarm Clock script

Posted on
Sun Nov 26, 2017 6:30 pm
hamw offline
Posts: 1212
Joined: Mar 31, 2008

First of many... Alarm Clock script

Would appreciate some help with this is handy little script that changes the execution time for a schedule, With this I run my whole house alarm clock, which turns on the audio, speaks the weather, etc. I will likely need some help with those too....

Code: Select all
using terms from application "IndigoServer"
   set theCurrentDateTime to absolute trigger time of time date action "Radio WakeUP Actual WakeUp Time"
   set AppleScript's text item delimiters to ":"
   set theTargetTime to value of variable "RadioWakeUpDisplay"
   set hours of theCurrentDateTime to (text item 1 of theTargetTime) as number
   set minutes of theCurrentDateTime to (text item 2 of theTargetTime) as number
   set absolute trigger time of time date action "Radio WakeUP Actual WakeUp Time" to theCurrentDateTime
   set the value of the variable "RadioWakeUpEnabled" to "Yes, Actual Time"
end using terms from

Posted on
Sun Nov 26, 2017 7:44 pm
FlyingDiver offline
User avatar
Posts: 7211
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: First of many... Alarm Clock script

Strongly suggest that if you're writing new scripts, you do it in Python not AppleScript. AppleScript is being deprecated in Indigo.

joe (aka FlyingDiver)
my plugins: http://forums.indigodomo.com/viewforum.php?f=177

Posted on
Sun Nov 26, 2017 8:06 pm
jay (support) offline
Site Admin
User avatar
Posts: 18212
Joined: Mar 19, 2008
Location: Austin, Texas

Re: First of many... Alarm Clock script

@FlyingDiver, that's what he's asking for: help converting this script to Python (that's what this forum is for)... ;)

This script won't convert directly (at the moment) because the IOM doesn't support setting the attributes on a Schedule object. Creating/Updating Triggers/Schedules/Actions are still spotty in terms of the IOM though this will improve.

I suspect there are other approaches to solving this issue. If you can describe more fully the problem that this script is solving perhaps we can help you figure out a different approach...

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Posted on
Sun Nov 26, 2017 8:09 pm
FlyingDiver offline
User avatar
Posts: 7211
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: First of many... Alarm Clock script

jay (support) wrote:
@FlyingDiver, that's what he's asking for: help converting this script to Python (that's what this forum is for)... ;)


Oops. :oops:

joe (aka FlyingDiver)
my plugins: http://forums.indigodomo.com/viewforum.php?f=177

Posted on
Thu Nov 30, 2017 10:05 pm
hamw offline
Posts: 1212
Joined: Mar 31, 2008

Re: First of many... Alarm Clock script

Jay, here's where you helped me with the script many moons ago...
viewtopic.php?f=7&t=5063&p=33962&hilit=alarm+clock#p33962

But, in looking for that post, I found what appears to be a ready made replacement, thanks to @colorodo4wheeler:
viewtopic.php?f=196&t=16229&hilit=alarm+clock

I'll give that a try first and see how it works, Might solve the issue totally.

Thanks,

Ham

PS: @flyingdiver... I am going to try to convert as I can. But it's a big project... :-(

Posted on
Fri Dec 01, 2017 9:20 am
jay (support) offline
Site Admin
User avatar
Posts: 18212
Joined: Mar 19, 2008
Location: Austin, Texas

Re: First of many... Alarm Clock script

hamw wrote:
But, in looking for that post, I found what appears to be a ready made replacement, thanks to @colorodo4wheeler:
viewtopic.php?f=196&t=16229&hilit=alarm+clock


Yep - I suspect that a lot of what people have AppleScripts for are now solved by plugins.

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 2 guests

cron