Dynamically Specifying Image to Find from a File?

Is there way to dynamically load a image to find from a file?
I have an action for if the screen contains image in area, but I need to load the image to find dynamically instead of static image to search.
Is there way to specify a filename instead of pasting a static image, and then I can just change the content of the file?
Thank you in advance!

Not that I know of.

What are you searching, a web page?
And if you find the image, then what, click on it?

If so, then you are probably better of using Execute a JavaScript in Browser action (KM Wiki) to find the image based on image name, or on the HTML tags/classes/ID used with the image. Once you find the proper HTML element, there are several ways to click it or open its URL.

Hey @Chi,


This feature has been requested several times though.

Perhaps you should make a formal feature request.


@JMichaelTX I’m searching an icon with no tag for a library loaded on an app. It’s not html based, and the interface is totally bitmap, so you can’t search anything using JXA.
@ccstone is there a formal place to post feature request?
@peternlewis do you mind looking into implementing this feature? It would be awesome!

You can email support@stairways.com or generally you can post them here.

It is largely a UI issue, it would require some way to specify that the image comes from a file, which is rather ugly given the existing UI. It may happen, but it’s not particularly likely.

You could perhaps build the action XML manually and then execute it with a do script command to the engine.

What do you want to do with the found image?
What is the purpose of finding it?
What is the next workflow step after finding it?

Thanks @peternlewis!
How do I go about building the action XML manually and then executing it
with a do script command to the engine?
This would be probably the best approach for now. I’d appreciate any
tip! Would it be possible with JXA?
@JMichaelTX, I need to know which library is loaded, and enable/disable
macro groups for the particular loaded library.

@peternlewis also being able to execute this with an AppleScript would
be amazing!
JXA: result = kme.findImage(filePath, {area:“x,y,w,h,f”})

What app are you using?
Does the app window title reflect which library is loaded?
Can you provide a screenshot?

It is possible that using AppleScript GUI code to read the window elements, and possibly one of them contains the name/ID of the library.

It’s Logic and Kontakt, and the plugin window for Kontakt can’t be read
through AppleScript/JXA at all.
Window title doesn’t change either. The entire window is based on
bitmap, so you can’t rely on the system events suites for apple script.
Unfortunately I have to collect bunch of images and coordinates, and
purely work with them.
I wish there was an easier way to build xml for find image action, and
run do script.