My recommendation is to do a web search for something like ‘Epson test page print’ and see if you can find either the same one that it prints or something which will serve the same purpose.
Once you find it, save it as a PDF (use the “Print to PDF” feature in macOS if needed) and save it as a PDF to something like
Create a new Keyboard Maestro macro and add the action “Open a File, Folder or Application” to it.
It will look like this:
Note the area I have circled in blue and the red rectangle.
Click on the icon in the blue circle and select your
~/Documents/TestPage.pdf file. It should now look like this:
Now click where it says “Default Application” and it will show you a list of your running applications. But you want to ignore all of those and go down to “Other…” as shown here:
Keyboard Maestro will open a window to your “Applications” folder, which is usually what we would want. But not in this case.
Press Command+Shift+G (⌘⇧G) which will bring up “Go to Folder…” and enter
It should look like this:
Click “Go” and now you should see some “apps” for all of your printers. Select the one for your “Epson SC-P7500”. I don’t have that exact same printer, but here’s how it looks if I select my Brother HL 2270DW:
Now, when that macro runs, it should print that PDF that you told it to open. When you run it, you should see the app open in the dock.
If the app stays in the Dock…
For some reason, when we do this the printer app does not quit itself, and ends up hanging around in the dock, which is not what we want.
If that happens to you, add a “Quit a Specific Application” action, and in the list of running apps, look for
Once you select
PrinterProxy Keyboard Maestro should show you the actual name of the app that you were expecting:
Now you have a Keyboard Maestro macro which should printer your test page and quit the printer application, and it should work even if your Mac screen is locked.
End of lesson…
“But TJ! What if I want a geekier solution which is going to be slightly harder to set up and involves a shell script!?!”
Well, ok, since you asked…
(Note: the following is another option that you could use instead of what I described above. You do not need both.)
There is a Unix command
lpr which you could use.
If you only have one printer, or if the Epson is your default, it’s extremely easy. Just use this:
in a Keyboard Maestro macro “Execute a Shell Script” and BAM! you should be done.
It gets trickier if you have more than one printer because then you need to use the
-P flag and the CUPS name of the printer, which (for me) is
Brother_HL_2270DW_series so I would use this:
lpr -P "Brother_HL_2270DW_series" \
To find the CUPS name, go to System Preferences » Printers & Scanners then select your printer, and finally click the ‘Options & Supplies’ button:
Once there, look for the “Device Name” shown here:
Pro Tip: If you double-click on the Device Name you can “copy” it to the clipboard and then paste it into your Keyboard Maestro macro.