1

I'd like to automate printing the first 3 pages of a PDF. It's fine if the document has to be split.

I have Adobe Acrobat Pro installed as well.

  • do you want them printed one-sided or two-sided? – Steven Peters Oct 12 '18 at 17:16
  • From command line, you can use the lpr command with option -o page-ranges=1-3. For example file name aa,pdf use lpr aa.pdf -o page-ranges=1-3 – jmh Oct 12 '18 at 19:38
  • @StevenPeters yes, it should be printed recto-verso – paralyys Oct 15 '18 at 10:04
  • Do you want to create a Finder service using key combinations? Something like this: ⌘+O [Open file] delay 5 [Wait Acrobat to load] ⌘+P [Open print dialog] Tab Tab Tab ... [goto pages field] Keytroke "1,2,3" etc? – Mateus Ribeiro Oct 16 '18 at 1:39
  • 1
    @MateusRibeiro not really, but will do it like that if needed! – paralyys Oct 17 '18 at 11:01
0

This will prompt you to select the PDF file, then print the first 3 pages of it(change the sourceFile variable if you want to choose the PDF in another way):

set sourceFile to (choose file with prompt "Choose a PDF file:" of type {"PDF"})
do shell script "lpr " & quoted form of POSIX path of sourceFile & " -o page-ranges=1-3"

If you want to have a drag-and-drop application:

on open droppedItem set sourceFile to POSIX path of droppedItem
do shell script "lpr " & quoted form of POSIX path of sourceFile & " -o page-ranges=1-3" end open
  • 1
    This did the trick, I created an app with on open droppedItem set sourceFile to POSIX path of droppedItem do shell script "lpr " & quoted form of POSIX path of sourceFile & " -o page-ranges=1-3" end open . For some reason -o sides=two-sided-long-edge doesn't work. I made the default printer setiing double sided, so it works for now. – paralyys Oct 17 '18 at 11:03

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .