Trigger for existence of file

Is there a trigger for the existence of a file? When my backup job ends, it writes a file. I want to test for the existence of that file. (And if found run an action to put the machine to sleep.) The Folder Trigger doesn't seem to do quite what I want.

1 Like

Why not? Looks fine to me.
The Macro %TriggerValue% is the file path added to the folder, so, just do this:

image

1 Like

Very nice -- thank you @JMichaelTX. That did exactly what I needed, and there doesn't seem to be any appreciable CPU utilization waiting for that trigger to happen. I marked your post as a "solution".

1 Like

You most likely won't notice it. This is handled by a very efficient Mac API that Apple provides.

As an alternative you could set a trigger on the quit of your backup app.

Here I use BBEdit as an example of an app quitting:

image

1 Like

I think he meant "the token %TriggerValue%." If that misspeak can throw me off for 30 seconds, it can probably also throw off a new user too. If you fix the post, JM, you can delete my correction.

1 Like

Nope, it is not a misspeak. To be a tiny bit clearer, I could have said:

The Macro's %TriggerValue%
OR
The %TriggerValue% of the Macro

%TriggerValue% is a property of the Macro.

I'd suggest that you let other users speak for themselves. A quick search for this term in the Keyboard Maestro Wiki will provide you with quick clarification.

If someone wants to mediate between us on this particular issue, I will accept their judgment if you do also.

If you had said "the Macro's %TriggerValue%" I certainly would have understood you. The phrase "The Macro %TriggerValue%" is still technically wrong. Adding "apostrophe s" changes the meaning completely. Then it would be both clear and correct. An even better phrase would be "The macro's %TriggerValue% token."

There's been friction between us for quite a while, arguing about things like this. One way forward is to just accept the ongoing tension between us and deal with it politely. Another way is to ban me from this website. Or I can just voluntarily depart. If you don't mind, I'll just finish the support that I have ongoing with a couple of people before I consider voluntarily departing.