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

So do a loop and test to see whether find was successful?

Correct.

I’m trying to use KM in a particular workflow in Citrix (Epic) that depends on KM knowing what the name of a pop-up dialog window is. Do you know any way of doing that?

Have you tried using the KM Token “%FrontWindowName%” ?

Would that work? I don’t think that KM “sees” windows in a virtualized Citrix environment.

I should have clarified: this isn’t a popup window generated by citrix.app. It’s a popup window in the virtualized Citrix screen. A Windows application called Epic Hyperspace.

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