Solution: combining PDFs using RunRev on Mac OS X

Andre Garzia soapdog at
Sat Oct 21 11:12:09 EDT 2006


You can always write a text script file to be run by bash and execute  
it thru shell, then it would execute all your concatenations in one  
pass and free you from the tedious 1024 limit. Maybe depending on  
license issues and dependencies, you can extract from that  
bundle and bundle it with your application, but before doing so, you  
need to check its license so that it is not a crime and also check to  
see if the has any dependencies or hard coded path  
information. This would work on all MacOS X with python installed  
(which is all mac os x) but on windows, I think you'd need some other  


On Oct 21, 2006, at 1:02 PM, Bruce A. Pokras wrote:

> Hello group,
> A couple of times I and others have asked about a way to combine  
> PDF files using a RunRev script. I don't recall ever seeing an  
> answer, so I would like to share the solution that I found.
> There is an Automator action under OS X that combines PDFs. Someone  
> on an Automator mailing list looked into that action and found that  
> it was run by a fairly simple Python script. Since Python scripts  
> can be run from the Shell, it was fairly straight forward to adopt  
> that to RunRev. Here is the actual commnad:
> get shell("python '/System/Library/Automator/Combine PDF  
> Pages.action/Contents/Resources/' -o" && outputFile &&  
> inputFiles
> outputFile is the full path to the file you are creating that  
> contains all the PDF pages. It must be surrounded by single quotes.  
> E..g., '/Bruce/Documents/Patents/5000000.pdf'
> inputFiles is a list of full paths to the files you are combining  
> with each full path surrounded by single quotes and each separated  
> from the other by a space. E.g., '/Bruce/Documents/Patents/ 
> 5000000/5000000-001.pdf' '/Bruce/Documents/Patents/ 
> 5000000/5000000-002.pdf' '/Bruce/Documents/Patents/ 
> 5000000/5000000-003.pdf' '/Bruce/Documents/Patents/ 
> 5000000/5000000-004.pdf'
> The one "gotcha" is that a shell command cannot have more than 1024  
> characters. So if you want to combine a lot of pages, you will need  
> to incrementally add files to the outputFile. This means naming  
> outputFile as one of the inputFiles for the second through last  
> loops. You could add one page at a time to the outputFile or as  
> many as possible (per my above example), but I have found that  
> adding one page at a time to be much slower than adding as many as  
> possible through each iteration.
> Does anyone know in which version of OS X the "Combine PDF pages"  
> Automator action was introduced?
> Theoretically, the free pdftk PDF tool would allow RunRev Windows  
> apps to do this, also. I will be trying that out once my OS X app  
> is completed.
> Regards,
> Bruce Pokras
> Blazing Dawn Software
> _______________________________________________
> use-revolution mailing list
> use-revolution at
> Please visit this url to subscribe, unsubscribe and manage your  
> subscription preferences:

More information about the Use-livecode mailing list