Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Click here to return to the 'An AppleScript for combining multi-page PDFs' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
An AppleScript for combining multi-page PDFs
Authored by: paulrob on Jun 04, '03 02:16:25PM


I had rather hoped that my original post wouldn't make it to the big screen. As you might have guessed I'm still learning Applescript. I'm a bit red faced!

I have now "discovered" Scripting Additions as used by Dark Shadow. And got rid of the first clunky loop too! The combined PaulRob/Dark Shadow script is: -

on open (theItems)
set userDesktop to the path to desktop from user domain as text
set output_name to (choose file name with prompt
"Enter output filename" default name userDesktop & "untitled.pdf") as string
set UnixScript to "joinPDF " & "'" & (POSIX path of output_name) & "'"
repeat with aFile in theItems
set UnixScript to UnixScript & space & "'" & (POSIX path of aFile) & "'"
end repeat
do shell script UnixScript
end open


[ Reply to This | # ]
An AppleScript for combining multi-page PDFs
Authored by: mr. applescript on Jun 04, '03 02:41:38PM

If you want to quote the POSIX path use the parameter "quoted form" as in this example:

quoted form of POSIX path of (choose file name)

-- returns: "'/Users/yourname/Desktop/myfile.pdf'"

The "quoted form" parameter adds the single quotes for you. The Apple TechNote for the Do Shell Script command is here:


[ Reply to This | # ]