How to Select an Item in a Pop Up Menu

Help needed with how to select a choice in a pop up (drop down) menu in a modal dialog box.

In Adobe Bridge, one step in a complicated macro is to Open Batch Rename (easy, it has a keyboard shortcut), but then how do I get the macro to select one of several presets by name (in case it is not the last one used)? The image shows how it looks: You click on the preset choices, click on which one you want, then click on the Rename button, but can KM do this kind of selection? (I assume the answer is a resounding, "Duh, of course!" But I can't figure it out.) thx

On the one hand, KM can do anything. On the other hand, the reliable way to solve a problem like this is to use AppleScript (or use Keyboard shortcuts that the app provides, if any.) I have no idea if your app supports AppleScript sufficiently to do this easily and accurately. As for keyboard shortcuts, you should look through the menus to see if these are available there.

But if neither of those ideas pan out, there is a tricky solution using screen reading (optionally, using OCR.) Whether this works for you depends upon trial and error and the exact nature of the pop-up menu. In this case, I think I could get it to work, but perhaps only if I had the app, because this approach requires a lot of finessing. For example, I'd need to see the physical position of the pop-up. Your screen image shows it, but your screen image doesn't show if the position changes based on where you click in the box, or whether the position changes if your window is close to the top of the screen. There are lots of tricky scenarios here, and if I could get it to work, it might take 2-3 seconds to do this, and I'm not sure if that's fast enough for your requirements.

So plan A is for you to find out if your app supports AppleScript, and if so ask someone how to execute this using that. Plan B is to check if your app has keyboard shortcuts for these menu items (probably not.) And Plan C is to either give up or do some tricky screen analysis.

Those are my ideas. And I'm running about 80% correct answers this week.

OK, thanks. There are not any keyboard shortcuts and AS is just too much for me to deal with for this but upon thinking about your answer I realized Adobe Bridge does have a Workflow feature, that's sort of a macro-ish setup for multiple steps. In a workflow you can tell it to use a specific Batch Rename Preset and that specific workflow can be accessed via a regular menu selection, which I think KM should be able to handle without too much effort. My main issue was wanting to intelligently select the Rename Preset, not do it by relative cursor clicks, which the Workflow approach solves.
Create a workflow...


...then use a KM macro to select it from a normal menu:

1 Like