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

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

@peternlewis @JMichaelTX @ccstone @gglick @mrpasini
thank you all for your comments.

I found a solution using gmail snooze

basically, I want to backup my google calendar every week with the macro above.
I can't do it using a time trigger because I have no way of knowing if my computer will be asleep.

Solution: compose an email and attach a text file entitled 'google calendar backup' → send it once so it is in the inbox → once it is in the inbox, I snooze the email so that it is sent one week later → in one week when I receive the email I click on download file → when the file appears in my download folder it triggers a Hazel rule → the Hazel rule triggers the KBM macro above

It works fine and bypasses the computer asleep issue when exact time is not an issue.

I just don't understand how you can even consider using a time trigger if you don't know if your computer will be asleep or not.
If you want to use time triggers, it is a question of the pros and cons of never letting your computer sleep, assuming you have a SSD drive

Off the top of my head I can't think of a better solution, but if you're going to use a solution like this you can at least cut out the text file and Hazel rule parts. Just include a URL link to run the macro in your email and click on that when you get the email.

You could also do something similar if you use a to-do app like Things or OmniFocus; just set up a task that repeats once a week, include the URL to the macro in the note field, and click that when you go to mark the task complete for that week to run the macro.

1 Like

thank you. It's a good idea. I am going crazy trying to figure out the macro's name or UUID to implement you excellent solution. I tried UUID extraction macros from the library but they do not work. I tried to display the UUID token but it does not work either.
Funny that there is not a 'right click' → copy UUID, like one would have right click → copy link

You're welcome. There may not be a right click to get a macro's UUID (though there is a menu option for it under Edit > Copy as > Copy UUID) but there is a much easier way to get the URL for running a macro than what you've been trying:

Jun-26-2019%2017-18-07

1 Like

you are fantastic !! great !! thanks for the effort in making a video. I am very grateful

1 Like

neither gmail nor apple mail recognize the following as a functional link. I tried both a simple paste and also paste into create link.
this is the link I used
kmtrigger://macro=2ED527D3-3E53-4322-8196-6CCB1D94F02D

The link in itself is fine because it works in Evernote (clickable, functional)

Hmm. True, Gmail doesn't seem to recognize it even when pasted with a link, but Apple Mail (at least on Mojave 10.14.5) seems to recognize it fine:

43%20PM

As does my email client of choice, Spark:

44%20PM

1 Like

yes, thank you. There was a glitch and now works with apple mail.

If there's no hoop, you can't jump through it. How about setting the backup to run either 1) on wake with the Wake Trigger (if it's quick) or 2) on sleep with the Sleep Trigger?

BTW, MacScripter has a nice summary of what you can and can't do (like schedule more than one pair of wake/sleep schedules) using pmset in a script.

1 Like