Created
February 20, 2018 19:46
-
-
Save sbrinkmann/e786b3a6844f0ad11dff8b4b255600ae to your computer and use it in GitHub Desktop.
Mac OS Join and Replace PDFs Selected PDFs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| echo "foo" >> /Users/sbrinkmann/merge.log | |
| echo "$*" >> /Users/sbrinkmann/merge.log | |
| fileNames=$(echo "$*") | |
| fullfile=$1 | |
| filePath=$(dirname $fullfile) | |
| fname=$(basename $fullfile) | |
| fbname=${fname%.*} | |
| "/System/Library/Automator/Combine PDF Pages.action/Contents/Resources/join.py" -o "${filePath}/${fbname}-combined.pdf" ${fileNames} | |
| for i in "$@"; do | |
| rm "${i}" | |
| done | |
| mv "${filePath}/${fbname}-combined.pdf" "${filePath}/${fbname}.pdf" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment