Combine 2 PDF files into 1 using applescript
Hi all,
I am just starting out with applescript and could do with a pointer please. I have written a script which saves two pdf files from an active Illustrator document in the source folder of that document. The issue I am have now is that I cannot get the two files to combine into a single PDF file.
The whole script is quite long and is works apart from the combine PDF part, I will paste the part of the code I am having problems with and hopefully someone can help me out please:
------------------- start of PDF combine script
tell application "Finder"
try
open (every document file of container of file_path whose name contains ".pdf")
on error
display dialog "no PDF file located"
end try
end tell
tell application "Adobe Acrobat Pro" to activate
tell application "Adobe Acrobat Pro"
set docRefA to the active doc
tell application "Finder"
try
open (every document file of container of container of file_path whose name contains ".pdf")
on error
display dialog "no PDF file located"
end try
end tell
tell application "Adobe Acrobat Pro" to activate
tell application "Adobe Acrobat Pro"
set docRefb to the active doc
bring to front docRefA
insert pages docRefA after 1 from docRefb starting with 1
end tell
end tell
------------------------------------- script end
Both PDF documents open and are set as the variables docRefA and docRefb, but the acrobat command 'bring to front' and 'insert page' do not seem to be working. I get an error come up in an illustrator dialog box saying "Adobe Acrobat Pro got an error: document "84056_R1.pdf" doesn't understand the bring to front message".
Mac OS X (10.6.8)