Merging pdf files with AppleScript?

I have two pdf files, one named ahq1.pdf which contains a set of questions, the other named aha1.pdf which contains the answers to the questions. I need to append the second file at the end of the first one and rename the file as ah1.pdf.

I know that I can do this manually with Preview, but I need to do it with a script if possible. I do not have access to Acrobat Pro which I understand can be scripted. Can this be done with appleScript?


Martin Michel gave me one solution that alphabetizes and merges all the pdf files in a folder with a tool he wrote. He described it in this thread:

I’m open to other ideas as well, particularly any that let me specify which files to merge and in what order.