How to Change the Default Paper Size With Keyboard Maestro

As already written here in the last few days and weeks, the print function (save as pdf / export as pdf) has been changed by the update to macOS Ventura. After I updated all the Keyboard Maestro macros and they all work now fortunately, I tried a little bit.

I found out that it would be an advantage for me if I could change the default paper size as easy as possible.

The goal is to always change the default paper size after a few prints.

As it looks I can do it through system preferences, AppleScript or through the tTerminal!?!?

What is the best way / how do other Keyboard Maestro users do it.

Can anyone maybe help me?

I have never worked with the Script Debugger or AppleScript...

Hey @Tomaso71,

It looks possible, but all the listings I find on Google are old.

My printer is in mothballs right now, and I'm running Mojave – so I can't really test.

The stuff on Automators Talk looks recent and relevant.


Thank you for the answer. I came across a similar article, but I am not so familiar with the terminal...

The articles are all very old and I have the impression that something has changed in the background.

I also use Hazel and I will have a look at it.

In the meantime I use my own macro that works with Found Image. It works stably, but I've had problems with this action several times recently, so I'd be happy if there was another solution.

40) change default tm_individuel_250_x_1250 -> a4.kmmacros (60.0 KB)

If you want to see your change happening, this might work more reliably:

Change Default Paper Size.kmmacros (3.6 KB)


You may have increase the number in the AppleScript's delay 0.2 if you've a slower-responding system. Change keystroke "A5" to match the menu item you want to select.

If you want things to happen "invisibly" you can still use defaults in the shell, but the plist file is in a different place these days:

Change Default Paper Size Shell Version.kmmacros (1.7 KB)

Again, that sets the default paper size to A5 -- you'll see that you have to use the paper ID strings listed in the blog post you linked to. If the size you want isn't listed then set it in System Settings then run the following in Terminal to get the string needed:

defaults read  ~/Library/Preferences/org.cups.PrintingPrefs.plist DefaultPaperID

The AppleScript was exactly what I was looking for. I just had to add a delay of 0.2 after keystroke "A5" to make the macro even more reliable.
Thanks again...

1 Like