Hello Mellow yellow,
I'm away from my Mac at the moment so I can't be specific. One way to script automation is to use System Events on your Mac. It's crazy dangerous so you need to take care.
Basically you are going to send a set of keyboard strokes to the app of your choice. But if you get an unexpected dialogue box open up from another app then everything will go horribly wrong very quickly as the keyboard strokes go to whichever app is in focus on your Mac at the time..
Have a look at...
https://en.m.wikibooks.org/wiki/AppleScript_Programming/System_Events
You can yes this approach to call up Command +P.
# My advice is to use a "delay 2.0" (that's two seconds) between each instruction in case your Mac takes a while to process each instruction.
# Secondly don't leave your Mac unattended until you are confident that the script is working ok.
# Keep your script short and simple.
​​​​​​
# Finally, don't try to multi task when the script is running .
You can use System Events in AppleScript or in a AppleScript routine inside inside an Automator Workflow.
Let us know how you get on.