Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- use framework "Foundation"
- on run {input, parameters}
- set output to PdfDocumentFromFile(item 1 of input)
- repeat with doc in rest of input
- set pdf to PdfDocumentFromFile(doc)
- repeat with n from 1 to pdf's pageCount()
- (output's insertPage:(pdf's pageAtIndex:(n - 1)) atIndex:(output's pageCount()))
- end repeat
- end repeat
- tell application "Finder"
- move input to the trash
- end tell
- output's writeToFile:(POSIX path of (item 1 of input))
- return item 1 of input
- end run
- on PdfDocumentFromFile(fileName)
- return current application's PDFDocument's alloc()'s initWithURL:(current application's NSURL's fileURLWithPath:(POSIX path of fileName))
- end PdfDocumentFromFile
Advertisement
Add Comment
Please, Sign In to add comment