I am able to achieve this with keyboard shortcuts in macOS (see below); however, I would like to do this in KM so these macros will sync between my macs.
I've been able to replicate most keyboard shortcuts in macOS to KM with the "Select or Show a Menu Item" command, but I am not seeing the print dialog box drop down menu items from this KM command. Am I, perhaps, missing something? Again, I would appreciate your help.
No, you’re not missing anything. However, if it has a keyboard shortcut, you can always use the “Type a Keystroke” action to trigger the shortcut.
Or you could use some “Type a Keystroke” actions to do down-arrows, and enter.
Or you could use “Click at found image”, and screen-grab the part of the menu with the item to click on. Be careful with this method, however, if you have “Transparency” enabled, because it most likely won’t work all the time.
You’ve set some shortcuts using macOS. Everything should work if KM simulates those keystrokes.
For example, you have Command-P for Save As PDF, set using the OS. I have that as well. I then have a KM macro that gets me there by simulating Command-P once to invoke the Print dialog, pauses, then simulates Command-P again to invoke Save As PDF. Something similar should work for the situation you describe with any of the drop-down menu commands you’ve created.
If pressing the menu shortcuts works, then simulating the keystroke with Keyboard Maestro should work, but because the latter part of the menu is dynamic, it may not be generated until you click on it in which case typing the shortcut will not work, either manually or using the Type a Keystroke action.
When testing selection of a drop-down menu (like the PDF button menu), you have to manually type enough of the menu item to be unique. The selection is NOT necessarily made in order of the items shown.
So, when I type "Save as", here is what I see:
But if I keep typing so that I have typed "Save as PDF", then the proper item is selected.
Before I wrote my macro, I had tested using your approach, but I didn't type enough of the menu item name in my manual test.
If you type “Save as” the system will select the alphabetically first menu that starts with “Save as” which in this case is “Save as Adobe PDF”. If you type “Save as PDF” it will select the correct one.
It follows from other type-select places where the ordering may change. For example, you can use type select in the Finder in a Finder window, and it selects the same file regardless of the sort order of the listing.
Definitely. Probably the entire name ideally, even the ellipses if possible (and if it works).