'Correct' way to print current document in Preview

I have a macro that gets the latest PDF file from a folder, copies it to a folder, and opens it in Preview (the new file that is). So far so good. Now what I want is to open the print dialog, so I can can check the print settings and print it out. (I'm a researcher and I download a lot of PDF copies of articles; I copy them all to a huge folder and then, because I am old, I print them out so I can scribble on them.) Here is the macro by the way:

(I haven't included a copy because it's not finished.) At the moment I use 'Select or show a menu item' and it works fine. But I feel like relying on something I've typed in is not ideal. Or is it? Is there a better way or am I being too fussy? I've spent quite a while searching and I can't find anyone wanting advice on something so simple!

What do you mean by “something I’ve typed in”?

Well the menu title and menu item are just text fields, so if Apple changes what they’re called in the app menu it won’t work any more. It’s pretty unlikely, I know.

It's the joy and curse of all software that things change. I've had to tweak many Macros that suddenly stopped working because either the Mac or the App changed the ways it did things.

I don't think it is possible to ever make anything in Software completely future proof.

Me too. But this is the stuff that keeps us young :slight_smile:

1 Like

Potential workarounds for that include using regex to match the print function, or using a keystroke to type Command+P. Both of those are undesirable in my opinion.

The good thing is I think Keyboard Maestro will throw an error as a system notification (top right corner) when it tries to hit a menu item that isn't there, and I think it will abort the macro.

Ah, yes, you're right. Of course it will just throw an error and then I can fix it. I don't know what I thought was going to happen! Thanks.