For simplicity I did the time calculation based on minutes since last midnight, so this will break if the time interval crosses midninght, if this is a problem it can be changed to do a full datetime calculation
Thank you @Alexander and @tiffle for your replies, i will test them both and that should get me on the right track for sure. I'll reply as soon as i have time and a working solution;
1 nitpick i still need to solve: when i use the app, it can be for short periods of time (to enter data.) So, if the timer only fires every 5 minutes (versus when the app is active / activated) then it's possible you won't get any screenshots for a longer period of time even though the app is being used;
Screenshot timer / executed at 00:00, 00:05, 00:10, 00:15
App used at: 00:02 until 00:03 and 00:07 until 00:09
Macros are always disabled when imported into the Keyboard Maestro Editor.
The user must ensure the macro is enabled.
The user must also ensure the macro's parent macro-group is enabled.
System Information
macOS 14.1 (23B5067a) PRE-RELEASE SEED SOFTWARE
Keyboard Maestro v10.2
I wasn't sure about one requirement...
If an application is activated, and continues to stay in foreground, do you want to capture screenshots at the 5 minute frequency? If so, you can add the trigger that @tiffle had.
Thank you all for your input, i managed to use your examples to create something that works. Here is what i ended up using;
(@Alexander i had to adjust your Macro a bit because it saved the variable each time, even if no screenshot was taken, resulting in 0 screenshots for some time.)