Still have a problem with time date action !

Posted on
Thu Sep 21, 2006 10:50 pm
Lalit offline
Posts: 71
Joined: Jul 05, 2006
Location: Paris (France)

Still have a problem with time date action !

Hi,

I still have a problem with Time/Date action :
when I create manually or via Applescript a Time/Date action, the next trigger is always wrong when I choose every x hours or x minutes !!!
I have just understand the bug : if I choose every 20 minutes and if it's 06:32, it should trigger at 06:52 then 07:12 and.....

In fact I noticed that the reference of the beginning is not the current time but the time since 00:00.
So, for my previous example it will be : 00:20, 00:40.....06:00, 06:20, 06:40, 07:00 !

That's a problem for me because I use a lot of scripts which define a time date action with countdown

Look at this example :

property MachineLaverDuree : 90 -- it is a variable containing how many minutes my washing machine will run. I use : set dureeProgrammation to (value of variable "MachineLaverDuree") * 60

tell application "IndigoServer"
set dureeProgrammation to MachineLaverDuree * 60
--return dureeProgrammation (it's 5400)
set actionProgrammee to make new time date action with properties {name:"_Remind machine à laver_", time trigger type:countdown, countdown delta:dureeProgrammation, auto delete:true}
--next I have a action step that send me an email
end tell

If I execute this script at 06:40 it will trigger at 07:30 and not at 08:10

In the previous version of Indigo 1.8, it worked correctly !

It could be interesting if you add a beginning time (also in applescript dictionnary) for the row every X hours and x minutes and if I leave it blank it should be the current time !

N.B : if I erase the value 0 in a field I have an annoying dialog that say "the value entered is not within range". It shouldn't appear if the field is blank, it should consider blank as 0.


Thanks in advance !

Posted on
Fri Sep 22, 2006 8:57 am
matt (support) offline
Site Admin
User avatar
Posts: 21417
Joined: Jan 27, 2003
Location: Texas

Re: Still have a problem with time date action !

Yes, this is a not-so-subtle change in the way countdown Time/Date Actions work. They are always relative to midnight from the start date. I meant to document this, but I probably forgot.

The reasons for this are complex, but in-short it is because of all the new Time/Date options that now allow count down triggers on specific days. I'm considering adding a new field where you can specify the exact start time in addition to the already implemented start date. I'm still not sure if this will happen though.

But the real solution in this case is to not use a countdown type at all. Instead use an absolute time. This is better than the countdown type in this instance anyhow because the countdown type has some extra computational overhead that absolute time types do not. Here is what will work:

Code: Select all
set triggerTime to current date
set triggerTime to triggerTime + (MachineLaverDuree * 60)
set actionProgrammee to make new time date action with properties {name:"_Remind machine à laver_", date trigger type:absolute, time trigger type:absolute, absolute trigger time:triggerTime, auto delete:true}

Regards,
Matt

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 14 guests