written by JasonWalker
I’m doing something kind of similar with an action I have that constant polls the system. The idea is that I create a whole set of Actions that are constrained by a client setting (“PatchWindowState”), then allow all of the actions to run when PatchWindowState is set to certain values (the different values control how the machine behaves when patching is complete, like reboot timings, etc.)
if not exists last active time of action then true else (absolute value of (now - last active time of action)) > (if not exists setting “PatchWindowState” of client then 60 * minute else if value of setting “PatchWindowState” of client as lowercase = “closed” then 60 * minute else 10 * minute)
As a “fixlet”, (last active time of action) does not exist, so the if/then returns True. As an Action, this controls whether the action is reapplied after 60 minutes (when not in a patch window) or reapplied after 10 minutes (when in an active patch window).
What I’m not sure about, is whether “last active time of action” exists on the action’s first execution, or whether it is set after the first execution. So you could try
if not exists last active time of action then true else not exists running applications whose(name of it = “chrome.exe”)
You may get into a weird state around when “last active time of action” is created. If it does not exist on the first attempt to execute the action, then on the first attempt the “chrome” relevance would not be evaluated (but it would be evaluated for retry/reapply, I think).
You might also try
if not exists id of action then true else