"A Time" Trigger Capture Help Needed

@Nige_S

I'm afraid you are giving me more credit than is due. This may be a case of dumb luck.

I'll do my best to explain my example to the best of my ability. All the usual caveats apply.

First, my understanding from @Joel initial / originating post was that he was looking for a global variable to store the trigger time so that he could use it elsewhere. I did some searching around in the forum and found this post.

I use the example provided almost exactly. If you need a more thorough description of it, I recommend going back to that post and reading about it.

What I have attempted to demonstrate is how to create a global variable and store the trigger time of the macro.

Here goes...

  1. created "global" variable MacroTriggerTimeEpoch to store the trigger time of this macro.
  2. Pause for 9 seconds.
  3. called submacro asynchronously (here is the dumb luck, I was dogmatically following the example provided in the other post on TRIGGERTIME() which had asynchronously selected). This submacro stored its trigger time in a "global" variable floatUnixTime. This trigger time will be approximately 9 seconds later than the current macro's due to step 2.
  4. the Pause Until Conditions are Met compares the time differences between floatUnixTime (i.e., the trigger time of the submacro delayed by 9 seconds) and the trigger time of this macro. "Aside" -- I probably should have used the "global" variable MacroTriggerTimeEpoch to show its use. The value of these two are the same (MacroTriggerTimeEpoch is the TRIGGERTIME() of this macro). floatUnixTime is larger than MacroTriggerTimeEpoch due to the Pause for 9 seconds in step 2. In retrospect, I don't think my demo macro even needs this step 4. More of me just following the dogma from the previous example.
  5. Displayed the calculated values demonstrating the use of "global" variable.

I hope this helps. I am still quite new to Keyboard Maestro and I do not have experience as a software developer or the like. I am finding this work intriguing to the point where I am questioning my career decisions from 30 years ago. But alas, that ship has sailed.