Trigger with a "found" image

Hi,

I want to set a trigger with a "Found" image. I have a Firefox page opened with a website that displays a timer that changing every second, from 1:00 minute to 0:00 embeded in the webpage. I want to set a trigger when KM detects that the timer hit 0:00.

Any ideas?

Thank you very much for your help!
François

There is no Trigger for "Found Image", but you could use a Periodic trigger to trigger once a second, then do a If Then Else action with a Found Image condition.

But that depends on how large and distinct the "0:00" is. Found Image can be tricky.
If might not find a "0:00" like the text on this page.

You'll just have to test to find out if it works.

Thank you very much, JMichaelTX, it works almost perfectly!

I mean, the "found" image works 9 out of 10, and i am pretty sure that it's because it's not possible to enter time value less than a second in the "Periodically while logged in / Repeat every 1 second", and the "Found" image last precisely one second also on the Firefox webpage, so a timing offset must occur and KM miss the found image from time to time, no? I carefully adjust the fuzziness too, and even with that, i did not have a perfect result so far.

Any other ideas to improve my setup? Maybe use an apple script or something to be able to enter a value in millisecond instead of a whole second?

Also: to improve responsiveness, try to reduce the area where the image is going to be searched for

Another thing i don't understand is that actions will not be performed after my "Found" image trigger and i really don't know why but i'm new to KM. Here is the macro, so you can see that i just want to have KM to execute the Spacebar keystroke in an app called REAPER. So far, nothing is happening except that i can see the "display" of the found image when that happened, but no action is launched after that...

Thanks for you help!

It is probably a timing issue.
Add more time, like 0.5 sec, to your pause.

In fact, use a Pause Until Reaper is frontmost.
Then a fixed pause of 0.1 to 0.2 should work.

Thanks for helping me, it's really apreciated, JMichaelTX!

I tried what you suggested, and it didn't work. KM doesn't seem to do anything after the trigger. REAPER doesn't go front, even with Pause or Pause Until... It's strange, it's like KM starts the loop over and over, and no action could be triggered because of the timing of 1 second that seems too short?

That means that KM does NOT find the image.

I would insert a Notification at the top of the IF/THEN and the ELSE to display "Image Found" and "Image NOT Found".

You need to upload your Macro file if you want us to test it.
See How to upload your macro. Instructions for uploading to an existing post are just below the main instruction.
You may also find this Macro useful: MACRO: Upload KM Macro to New or Existing Topic @KM [Pub]

Here's my TEST macro that works with the timer on this page:
https://www.google.com/search?q=timer

Below is just an example written in response to your request. You will need to use as an example and/or change to meet your workflow automation needs.

Please let us know if it meets your needs.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

MACRO:   Run Macro When Timer Hits Zero [Exampe]

-~~~ VER: 1.0    2021-06-01 ~~~
Requires: KM 8.2.4+   macOS 10.11 (El Capitan)+
(Macro was written & tested using KM 9.0+ on macOS 10.14.5 (Mojave))

DOWNLOAD Macro File:

Run Macro When Timer Hits Zero [Exampe].kmmacros
Note: This Macro was uploaded in a DISABLED state. You must enable before it can be triggered.


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

I enable the above Macro when the timer is running and I want to check for zero with this macro:

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

MACRO:   Enable Macro Timer Check

-~~~ VER: 1.0    2021-06-01 ~~~
Requires: KM 8.2.4+   macOS 10.11 (El Capitan)+
(Macro was written & tested using KM 9.0+ on macOS 10.14.5 (Mojave))

DOWNLOAD Macro File:

Enable Macro Timer Check.kmmacros
Note: This Macro was uploaded in a DISABLED state. You must enable before it can be triggered.


I'm pretty sure the Found image works because if i enable the "Display button", i can see that the image is highlighted when the image is found. But you can see better than me with the macro i send you here:

Here is my macro:

Found image as trigger Macro (v9.2)

Found image as trigger.kmmacros (18 KB)

Well, i hope you received my macro. I hit the Share button and did all like in the tutorial video. Thank you!

Now it's working good! I downloaded your macro template called "Run Macro When Timer Hits Zero [Exampe]" and it works perfectly, thanks to you! I can't figure out what i missed with my macro, but this one is working great.

Best!
François

1 Like