Another way to print your pdf’s is to use LPR - much less overhead and way faster.
Here’s something close to what I’ve been using and it has worked well for me.
lpr -P some_printer /path/to/the/file.pdf
1st. Launch Terminal (under application/utilities) and type the following to get a list of your printers.
lpstat -l
This will list your printers and should look something like.
Find the printer you want to send to, and copy the name, or the name and IP if shown. Depends on how you have it set up.
At this point, you could try out lpr by typing
"lpr -P " then paste your printer name here, put a space after that and drag a pdf of your choice to the terminal window. Then, just hit enter.
Now, how to get that in a script to work.
Since you have the printer name your script can now set a variable to this.
set myPrinter to "whateveryoucopied"
Now, you just need a file path - and it has to be a posix path “/directory/directory/file”.
Here’s a snippet that lists a folder, and gets the posix path of each item.
set myfolder to "Your Computer name:Users:SomeUser:Desktop:Jobs:"
set myFiles to list folder myfolder without invisibles
repeat with x from 1 to count myfiles
set thisPath to posix path of file (myFolder &(item x of myFiles) as string)
--should return /Users/SomeUser/Desktop/Jobs/afile.pdf
end
Now, since we are getting the posix path for each file - we have all the information we need for our shell script. Include your printer name snippet as well.
set myPrinter to "whateveryoucopied"
set myfolder to "Your Computer name:Users:SomeUser:Desktop:Jobs:"
set myFiles to list folder myfolder without invisibles
repeat with x from 1 to count myfiles
set thisPath to posix path of file (myFolder &(item x of myFiles) as string)
--should return /Users/SomeUser/Desktop/Jobs/afile.pdf
set theShell to "lpr -P " & myPrinter & " " & thisPath
try
do shell script thisPath
--optionally log success here
on error err
--or, if there was a problem log that or send it to someone
end try
end repeat
Just thought I’d share something that’s been working for me. Hope it helps.