Trigger time

Just trying to understand this If condition.
I am inserting a number of minutes and watching to see what happens when all conditions are fulfilled.
Works for MONTH, DAY, HOUR but when I add TIME does not trigger when the time corresponds with actual time. (Just check time on Mac & add 1 minute and sit and watch).

What am I doing wrong?

Screen Shot 2021-07-24 at 05.49.34

I don’t know what you’re doing wrong, but a Cron trigger might be more useful for you. Just a suggestion

Cron works but still like to know what I am doing wrong with trigger attempt.

What you’re doing wrong is using MONTH, DAY, HOUR and MINUTE functions incorrectly.

For example, the function DAY(X) returns the day of the month of the unixtime X where Unixtime is the number of seconds since the start of 1970, GMT.

So by writing DAY(30), you’re asking the the day of the month corresponding 30 seconds after the start of 1970.

Your IF action conditions will, therefore, always take the true branch as each of those functions as you have written them will return non-zero.

The TIME function returns the current time as a unixtime value, or if you write
TIME(Y,M,D,H,M,S)
it returns the unixtime corresponding to the date Y/M/D at H:M:S

Have a look at the functions page in the KM wiki - Functions [Keyboard Maestro Wiki] and the unixtime page unixtime [Keyboard Maestro Wiki].

By the way - the IF action you’ve posted is not a Trigger but as you’ve described it as such I’m not completely clear what it is you’re trying to achieve.

Hope that helps.

Thanks for help. I ended up using this:

Screen Shot 2021-07-24 at 17.13.25

Did the trick. Found this really helpful that someone else posted;
https://crontab.guru/

I'm not sure how the crontab you referenced relates to the KM Cron trigger. The KM Wiki article provides some excellent examples.

To be clear to all readers, your use of the term "trigger" is confusing and incorrect in the context of the Keyboard Maestro app. See KM Wiki Article: Triggers .

As you have finally determined, and others have suggested, using a Macro with a Cron trigger or a Periodic trigger is most likely a better solution.

I'm not sure why you are using a IF/THEN Action, as it will immediately execute and either the THEN or the ELSE block will be executed. It will NOT wait for the time or period of interest.

If you have a Macro that needs to wait until a specific time or amount of time, then you can use Pause Until action or the Pause action.

KM has so many features and actions that it is impossible to know them all. Searching the Keyboard Maestro Wiki is advisable if you are not sure what is the best method to use.

Good luck!

1 Like

If I can remember my mis-takes later I can learn - hopefully.

Appreciate guidance.