OnScheduledTimer() event handler is getting called before it is due (exactly 1 second), the attached logs show me setting an 8am timer at 07:53, the event handler then sets the next timer on the next hour when 8am is reached - so at 8am the next timer should be 9am, but because the timer is getting called earlier than set, the handler is repeatedly called until the actual set time is reached. Script Output.txt (6.5 KB)
the error is fixable if SetScheduledTimer() is set 1 second ahead.
it is a simple reminder - shows a dialog every interval hours (config) from an anchor hour(config).
set
log level to 2
interval to 1
anchor to 12
it runs continuously (the script ends but SetScheduledTimer() is set again in OnScheduledTimer()) when started with Reminder START using the settings set in script configuration which defaults to every day at noon.
can be stopped and all variables and timers deleted with Reminder STOP
minimum interval is 1 hour, which means debugging can be a lengthy process.
The SetScheduledTimer() is set at line 396 (DO script editor)
if line 390 is changed to 1 second the error does not happen (EDIT: error still happens because it is 1 second out at your end).
OnScheduledTimer() event handler is at line 178.
Work in progress, will probably post it when finished. Reminder.opusscriptinstall (16.3 MB)
It seems that surprisingly galaxyhub has a point here. It's easily reproducible using the 'cmd2' command attached below. cmd2.opusscriptinstall (1.1 KB)