Clicking a pop up menu

Hello, I should probably start by saying I have zero idea how to program anything.

I’d like to make a macro that allows me to save a file in a specific format. I was somewhat easily able to figure out a macro that says File>Save but then I need to click a pop up menu and have it select a specific file type. Can anyone point me in the direction of how to learn this?

Thanks!

So I was able to record an action (automation?) of me walking through the process. Immediately learned a few things, one being that I needed to insert a pause command before the popup menu is selected.

This currently works how I want it to, but I worry this isn't the best way to accomplish things long-term. I'd love to learn more about programing these macros, but I'm not even sure what to search to start with. Perhaps I should also mention that I'm intending to use these with video editing programs like Avid and Premiere.

So where does some start learning how to write these macros from the very start?

Popup menus are tricky to control. To select a popup menu, you need to simulate a click on the menu, and then use typeahead to select the desired item, ie actions:

  • Click on popup menu
  • Insert Text by Typing "Menu Name%Return%"

The tricky part is clicking on the menu. First, make sure you have paused long enough to allow the window to come to the front and the screen to be stable, and then you can need to click on the popup. You can click in one of these ways:

  • if the window has keyboard focus, then you can click relative to the window, and if the popup menu is in a fixed location, then that may be a reliable solution.
  • click relative to the found image. If the popup menu always defaults to the same thing, then you can use the popup menu as the image. Otherwise, you need to click relative to something nearby that is consistent (like some label text).

To click relative to an image, you use the Mouse Click action, configure it to be relative to a found image, and take a screenshot of the desired area of the screen using Command-Control-Shift-4, and paste it into the image well on the action. The image has to be unique (which includes not being visible in the action if the image is small enough not to be shrunk in the image well) otherwise Keyboard Maestro will not know where to click. The Display option in the action will allow you to see where Keyboard Maestro is matching.

We can best help you if you would:

  1. Identify the App you are using to Save
  2. Post a screenshot of the File > Save dialog that shows the popup menu you need to open.
  3. Post a screenshot of the popup menu when it is open.

For example, using MS Word 365, I see this:

If your App Save dialog is something like this then most likely we can easily select/open the Format popup and then select the desired format.

Or, even better, if the App has scripting support, we might be able to do all by scripting.

I had a similar problem a Peter gave the same reply. I was able to get this to work on menus with a text entry field, but am unable to choose an item from a drop-down pick list. Specifically, the photoshop>File>Automate>Batch menu. I wish tto choose a Set of actions in the first box and the name of an action from the drop-down in the second drop-down pick list.


I can do it in a roundabout way, pointing the mouse at the box, saving your location, clicking, dragging to a menu item. The problem with the system menu items not in consistent location. I would like to somehow choose it by name.