Working with Print Services / Mail PDF

I have a brief macro that I run from within Preview.

It starts with cmd-P to open the print dialog.

I then need it to do the following:

  1. “click” the "“Selected Page in Sidebar” option
  2. change the orientation from portrait to landscape

right now it’s doing the above by using KM “Move & Click” - any way to do this with commands?

1 Like

You can use the Press Button action:

Press a Button.kmactions (0.3 KB)

Make sure the sheet has a chance to open, so you probably need a Pause after the Command-P.

The Orientation is more tricky. I see it has an accessibility label, but not a title, so I will see if I can have Press Button look for that if it does not find a better match.

Since the sheet is an focussed window, you can use Click relative to top left or right corner of the window to click on the Landscape/Portrait buttons. Or you can use Click and Found Image.