Is there a way to click on the image found in "Pause Until Found Image"?

Probably not, but it's worth a test macro to confirm one way or the other.

You also might try:

I my Citrix environment, it DOES correctly fetch the name of the front window! Thank goodness, because it decreases how much I have to check the screen! :grin:

I think there was something funky about there being an extra character in a window or something (at least at one point), so if doesn’t work, try doing a regex for something you know is in the title!

near-total KM neophyte here. Now I just have to figure out how to use the window title in an if/then.

Can you post some sample code for the macro that shows how you identify a window name in Citrix?

Here's an example. It tests for window containing "Hyperspace" in the title. It is a Citrix window and is detected by Keyboard Maestro with no problem...

1 Like

just saw: toward the bottom, my "Click at (0,0) from the Center of the Found Image action should have said in “front window” rather than in “all screens.” Best to decrease how much Keyboard Maestro has to go searching for images as much as possible :slight_smile:

Hi Peter,

Still have to painfully manually write loops to pause for an image and then click it :stuck_out_tongue:

Could you perhaps store the image coordinates of an image found in Pause Until in %ActionResult% ?

This assumes %ActionResult%.midx, %ActionResult%.midy would work…

If not, perhaps could automatically store in a default variable such as %Variable%FoundImageCoordinates%?

ActionResult would not work well, firstly it needs to be “OK” for a successful image, and secondly there might be multiple conditions, even multiple Image conditions, so it doesn’t make sense for it to be used as a result.

It is possible there could be some other token that could contain the last found image location.

yes, Yes, YES! :slight_smile: :slight_smile: :slight_smile:

I’ve added a %FoundImage% token for the next version.

4 Likes

My hero!! :heart_eyes:

Hi. Is there a new way to do this (a loop that clicks on a found image) with KM 8 ?

It would be nice if solutions proposed on KM's forum would be a little bit more detailed.

For example, when peternlewis writes:

Until
Pause 0.1 seconds
Find Image on Screen
variable Location is not empty
Click at Location.MidX, Location.MidY

I don't know where to set
Click at Location.MidX, Location.MidY
In an action ? In a script ?

Thank you.

As a general rule, my answers are very terse, because a) I don’t have a lot of time, and b) I believe people are better served by learning about the answer and figuring out the details themselves so they can apply them more constructively in the future.

You set Location.MidX and Location.MidY in the fields in the Click Mouse action. In the numeric fields, which expand to make room for variables once you start typing, as described in Text Fields.

Make sure the Click action is set to be relative “absolute”.

Hey Peri,

Your question is similarly lacking details. Please reframe it with more information about your process.

There are many examples of working with the found image on the forum, and then there’s the wiki.

Look for “found image” in the search on the wiki:

https://wiki.keyboardmaestro.com

-Chris

OK, OK. Thank you both of you.
(I thought KM was done for lazy people :smiley: Sometimes, I spend so many time to make a macro reliable that I wonder if the gain of time worth the effort. Its only because I am obstinate that I don’t give up. I like to learn by myself, I do it a lot since a couple of years but, you know, it is not often remunerative. )

Peter, I could have sworn that in a recent version you added a token that stores coordinates of found image if Pause Until image found succeeds? I can’t find it here or in wiki!

He did indeed. It’s called, appropriately enough, %FoundImage%. You can find the wiki page here: https://wiki.keyboardmaestro.com/token/FoundImage
And a prior thread showing it in action here: Drag Finder selection to “Found Image” in Chrome Browser window

1 Like

Thank you! I was trying to use imageloc :stuck_out_tongue:

Recommendations for the wiki (if I’m understanding this correctly):

  • the foundimage TOKEN page should link to “Pause Until” action
  • the found_image CONDITION page should explain the foundimage token
  • the “Pause Until” page has “found_image” as a condition but nothing about %FoundImage% as a result. Use of this should be an example, too, as it is extremely useful and confusing because of the token-vs-condition thing (to say nothing of the confusion introduced by the imageloc token if you’ve already been introduced to that :slight_smile: )

Thank you again for assistance!

1 Like

Argh, my code still is not working! I have the below code finding image in my Cerner-based medical record system. You can see that it is finding the image ("currently true"), but it's not getting the midx and midy results (the display text action shows the entire array followed by the text ".midx" for example).

Now I'm trying to calculate a midx and that doesn't work either (it will let me refer to the first element of FoundImage but doesn't like me referring to any others!):

What am I missing?