Search code examples
bashshellapplescriptbatch-processingpdf2swf

pdf2swf using MAC OS Batch command or Apple script


How do I write a batch process on the Mac for pdf2swf, I want to convert all pdfs in a folder into swf. But pdf2swf doesn't have a option to convert a folder of pdfs to swfs, you have to do it one at a time. I'm not sure how if I should use a Apple script or a Shell script, either one I'm not sure how to get or assign a file name variable.

pdf2swf file_name_variable.pdf -o file_name_variable.swf -T 9 -f

Thanks


Solution

  • Open up Terminal and do something like this:

    $ for f in `find /path/to/my/pdf/directory -name \*.pdf` ; do
    >   echo "Processing $f..."
    >   pdf2swf $f -o ${f/.pdf/.swf} -T 9 -f
    > done