Time of Day Trigger Not Working - Macro to Backup Google Calendars

Hello,
I wrote this elaborate award winning macro to make weekly GCal backups.
It is simple but very convenient, and also useful for users of the CloudPull backup app which did the job but went out of business on 15th of May..
How do I troubleshoot a non working time of day trigger?.
The macro works perfectly otherwise. Note that the downloaded file is subsequently handled (stored) by Hazel.

  • I wonder if for some bizarre reason, the trigger could be working in another time zone ? It's the only explanation I could this of, but it is far fetched.
  • I also wonder if there is any way around the time of day trigger not working when the computer is asleep.
    thank you

image

The workaround I use for this is in the Energy Saver system preferences under Schedule:

ss-59

1 Like

thank you for your reply.

  • the energy saver approach is interesting, but is unfortunately limited to only one entry which is very strange. What if you had 2 unrelated events to schedule?.
  • my time trigger still does not work. It works fine if I trigger it manually, which I cannot make sense of. Would @peternlewis have an idea of how to troubleshoot it ?

Hmmm, that file name is suspicious. Should it be exportical.zip instead of exporticalzip?

1 Like

strange as it may seem, the syntax to trigger an automatic google calendar is without the '.'
The macro works perfectly manually without a '.', and crashes with a '.'

If the file name is fine, and everything works when you trigger it manually, then did you perhaps make some change to the macro group this macro is in that would cause it to be inactive during the times you want it to run? It's best if you can upload the full macro rather than just a partial screenshot.

1 Like

It's not a partial screenshot. it's the whole macro which is very simple.
thanks for your reply

Thanks for posting a more complete image (the initial one was just cut off enough that it wasn't 100% clear if it was the whole thing or not). Uploading the full macro file is still easier for someone else to help troubleshoot, but this is certainly better.

At any rate, to answer this question:

The first thing I would try is to set the macro to a time a minute or two from when you go to test it and see what happens.

By the way, there may be something I'm missing, but in your last image, it looks as though you have your system set to wake on the one day of the week you don't want the macro to run. Is there a reason for that? If you want the macro to only run on Tuesday morning, then the time of day trigger should look like this:

39%20PM

1 Like

You're startup time is just a minute before the time you want the macro to run. Are you sure the system has finished starting up by then?

1 Like

@mrpasini @gglick

thank you both very much for your comments.

-GG: I did not want to upload the macro to save you time. I thought that it would be abusive to expect you to download it to look at it. Next time I will.

There is a misunderstanding.

  • I just added the sp energy saver schedule today, so please ignore it. The problem predates it.
  • the calendar download works fine and every time when I run the macro manually

Conclusion: the problem can only reside in the macro trigger command.

As per one of my snapshots, the problem does not reside in the the configuration of the global macro group which is always active for all apps.

I tried, as GGlick suggested, to set the macro trigger 2 minutes in the future, just sit at my wake computer, and wait for the macro to trigger, which does not happen. I did this a gazillion times.

There is something wrong with the trigger but very little to configure, and I can‘t figure it out.

Thank you for your concern. To assuage your worries, I can assure you that far from being abusive, uploading the macro file itself is the quickest and easiest way for anyone interested to see what the problem could be and fix it if necessary.

At any rate, when testing the trigger, did you try a much simpler macro, such as one that only shows a notification, to make sure that the macro is getting triggered at all?

One other thing I can think of; if you've been testing the current macro you have by changing its time to 2 minutes in the future and getting nothing, I wonder if it might be because, as of the last screenshot, the macro is set to not run on Tuesday? You didn't mention that in your response, so it's the last obvious thing I can think of as to what could be going wrong. Just to be 100% clear, when testing a time trigger macro, make sure the active days look like this:

23%20PM

Keyboard Maestro cannot do anything while the Mac is asleep.

You can schedule a wake up time, but other than that, Keyboard Maestro has no control over this.

Also, while the Mac is screen saving, screen locked or screen sleeping, many actions are blocked, especially anything related to UI.

The first thing to determine is whether the macro is firing or not.

After it fails to do anything, check the Engine.log file. Verify whether the macro was triggered or not.

That drives whether you look at the macro group configuration, the macro settings, and/or the trigger, or whether you look at the actions.

Alternately, you might try changing the trigger to the cron trigger to see if that works (or reveals anything).

ss-60

@peternlewis @gglick @mrpasini

thanks very much to all of you.

First, my apologies. @gglick was right: I inverted days on and off, which I corrected and everything is running fine now.

I have 2 suggestions for @peternlewis. @gglick and @mrpasini are welcome to comment.

1- I think that the default time trigger should be the white (off) panel rather than the blue panel for 2 reasons. I think that most people would assume that the default would be off, and the user chooses which days to trigger the time. at least in my case, the blue color does not especially suggest ON. Or how about forgetting about colors, leaving the time panel white for both on and off, with an on / off stamp visible within each clickable button. I think that the strikethrough is too faint.

2- the inability to run macros when the computer is asleep is a limitation of KBM, and since running macros at all time of day and night is a significant part of mac automation, it would be nice if some kind of solution could be suggested to users, as opposed to just stating that it's a limitation of KBM.

My point is that if an alternate solution is found, it is no longer a limitation of KBM. The energy saver wake up solution is an excellent one, and works perfectly in the case of the macro above.The problem with the energy saver solution is that it would appear that the user has only one single wake up choice (which can be repeated if necessary). If I want to run the above macros Tuesday at 7am, it would not appear possible to also wake up my computer Thursdays during the night to tape a webinar for example. The energy saver wake up does not have a (+) sign to add another wake up at another time.

Peter: it would perhaps be useful to let users know if there is any way (wake up app), to schedule multiple wake ups, which would make KBM fully functional whether the computer is awake or asleep. It then becomes basically irrelevant if the solution is found within KBM or not. Instead of the wake/sleep issue being a limitation of KBM, you could simply say that 'in order to run a macro when the computer is asleep you have to first'

I assume that KBM will not work in Power Nap mode either

sorry for the long comment

image

Could you possibly create a pmset based action to schedule a wake up to run a macro?

https://www.dssw.co.uk/reference/pmset.html

Hey @ronald,

Did you ever try this out?

Wake from Sleep as an Action

-Chris

1 Like

It's too much for me. I am too concerned about messing up my computer, but thank you for the suggestion.
Logically (and I admit that I am probably wrong), in view of the great number of actions available with KBM, I assume that if it was that simple, Peter would have implemented a pmset action a long time ago, to avoid having to say that KBM does not work when the computer is asleep (a major limitation). But this is speculation and I am a low level amateur.
Basically, I am not asking for much. In view of the limitations of energy saver ie the ability to configure only one event (single or repetitive), all I was asking is the ability to wake my computer on X date at Y time, after which time I would run a macro. Seems rather basic to me but does not seem to be a need in the Mac community.
How it is that it is not a pressing need for all those Automator afficiando, KBM users, appleScript programmers, etc frankly boggles my mind.
Take just one day like tomorrow: I would like my calendar backup program during the night when I am asleep using my macro which works (thanks to you), and I have to conferences to login to, one at noon and one at 2:30 pm for which I would like to use KBM to make the (slightly complex triple) login procedure automatic. Three events in just one day just for tomorrow !.
This is the only app I found and it is $50 : https://www.dssw.co.uk/powermanager/
Amphetamine, caffeine, etc do not allow you to schedule a wake up, which makes them basically useless for my needs.

I think you have already resolved your issue, and it was due to settings on your part.

But just to be clear to any future readers, I just ran this macro and it worked perfectly.
Note that my Mac was up and running, with no screen savers active.

image

1 Like

The trigger defaults to every day because otherwise it would default to doing nothing.

Blue is seen as on across the Mac, as seen in checkboxes for example:

image

The extra slash is to reenforce this. The strength of the slash is very hard (probably impossible) to get right - too light, and it is not seen, too dark and it obscures the letters - because the contrast settings vary from monitor to monitor, not to mention eye to eye.

If you turn off Edit mode, you get a clear description of the trigger.

There is no way to set wake schedules without root permissions.

Even ignoring that, there is only one scheduled wake possible, so for Keyboard Maestro to take that offer for its own use is probably problematic at best.

So basically, I'm afraid it is largely a system limitation that Keyboard Maestro, being a running application, cannot perform any tasks while the Mac is asleep or turned off.

I don't know. It might. It depends on how awake the Mac gets.

1 Like

thank you Peter