Just replying to my own message. (By the way, Michael Tsai, I haven't figured out a way to create or reply to private messages).
After playing around with PDFPen's Applescript library, I've figured out a way to easily combine PDFs.
Combining PDFs in PDFPen can be done without Applescript, but involves switching page views, selecting all, copy and pasting, which is a drag when I have 3 years worth of PDF files. Using AppleScript is much faster.
This results in one of the PDF files (the front one in PDFPen) having all the pages from the other files. Those other files are closed, but have to be manually deleted from EF.
This is the script I used. I'm not a very proficient AppleScript user. Feel free to change.
Code:
--combines PDF files.
--adds files from behind the front window, to the back of the front
--window. The arrangement of the final PDF pages, is determined by
--how the user "arranged" them by clicking on each one in turn.
--At the end, the only PDF file open, contains all the pages
--from all the other PDF files. Those files can be deleted from EagleFiler.
--EagleFiler will alter the page count on the final file, only when that
--file is previewed in EagleFiler.
tell application "PDFpen"
set NumDocs to count documents -- how many documents are open
if NumDocs > 1 then
-- copy pages from each document to the front (or back) of the first document
repeat with CurrDoc from 2 to NumDocs
duplicate pages of document CurrDoc to back of pages of document 1
end repeat
tell document 1 to save -- save the front document
end if
-- NOW, close all the windows except the front one (the one with the combined files.
if NumDocs > 1 then
repeat with CurrDoc from 2 to NumDocs
-- because documents are always closing, just close the 2nd document all the time.
close document 2
end repeat
end if
end tell