Keyboard Maestro is my last hope, I’ve tried everything built-in to macOS. I only want two macros, but I’ll pay for this app if it can do what I want.
Goal: when I am in Edit mode in Photos (macOS 10.13.1), I would like to hit a key combo and have Photos move to the Crop tab, select the 3:2 aspect ratio, and select Portrait (the second version of the macro would pick Landscape). This would leave the app ready for me to pick what gets cropped.
I can’t get KM to select the Crop tab. I tried using Press A Button, but it doesn’t seem that a tab is considered a button. I tried Click At Found Image, but KM says that grey text is really hard for it to find. I can’t use Move Or Click Mouse, because the location of the Crop tab button dynamically changes according to the window size. And so, I’m out of ideas at this point.
Any suggestions for me?
I should be able to get the aspect ratio and direction from the top-right corner with Move Or Click Mouse, that appears to be a fixed location.
You're in luck: selecting the Crop tab is actually the easiest part, since there's already a keyboard shortcut and menu command for it. My suggestion would be to try a "Select or Show a Menu Item" action, like this:
That will reliably switch Photos to the Crop tab, regardless of window size. From there, as you said, you should be able to use "Move or Click Mouse" with fixed coordinates based on the top-right corner to select the aspect ratio and Portrait or Landscape.
By the way, if these are your first macros, I'd also like to suggest a couple of other tips that should help it run more smoothly:
Create a macro group just for Photos and put these macros in it. This is to ensure that the macros only work when Photos is the foreground app (something that's especially important when using simulated mouse clicks based on the coordinates of the front window). You can read more on macro groups here if you're not sure how to create one just for Photos: https://wiki.keyboardmaestro.com/Macro_Groups
Add short "Pause" actions around each mouse click to give the UI time to register the clicks and change accordingly. If you have the macro click Portrait or Landscape too soon after clicking the 3:2 aspect ratio, the Portrait and Landscape icons won't have appeared yet, so the click will end up doing nothing.
Good luck, and feel free to post again if you have any other questions!