Page 1 of 1

First of many... Alarm Clock script

PostPosted: Sun Nov 26, 2017 6:30 pm
by hamw
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

Re: First of many... Alarm Clock script

PostPosted: Sun Nov 26, 2017 7:44 pm
by FlyingDiver
Strongly suggest that if you're writing new scripts, you do it in Python not AppleScript. AppleScript is being deprecated in Indigo.

Re: First of many... Alarm Clock script

PostPosted: Sun Nov 26, 2017 8:06 pm
by jay (support)
@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...

Re: First of many... Alarm Clock script

PostPosted: Sun Nov 26, 2017 8:09 pm
by FlyingDiver
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:

Re: First of many... Alarm Clock script

PostPosted: Thu Nov 30, 2017 10:05 pm
by hamw
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... :-(

Re: First of many... Alarm Clock script

PostPosted: Fri Dec 01, 2017 9:20 am
by jay (support)
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.