Applescript to combine PDF files

Discussion in 'Mac Programming' started by M-B-P, Jul 9, 2011.

  1. M-B-P macrumors regular

    May 15, 2010
    I need help with a script that will allow me to add a pre-selected PDF to the end of an existing PDF file using PDFpen 5. The file PDF file that I need to add is a one page file, like a coversheet.

    I'm new to applescript, but I tried to following code as a starting point:

    tell application "PDFpen 5"

    --The pre-defined file that I want to add.
    set addThisPdfPath to "/Users/John/Desktop/One/16729224NEO.pdf"
    set addThisPdf to POSIX path of addThisPdfPath

    set originalDoc to document 1
    set pageNum to 1
    duplicate page pageNum of addThisPdf to end of pages of originalDoc

    end tell

    When I run this I get the following error:
    error "PDFpen 5 got an error: Can’t make \"/\" into type specifier." number -1700 from "/" to specifier

    I think the problem is pulling the pre-defined file from my desktop folder, any help with will appreciated.
  2. M-B-P thread starter macrumors regular

    May 15, 2010
    Sorry, forgot to add screenshot

    Attached Files:

Share This Page