You are not logged in.
Ok, I got this cool shell script for combining pdfs. I love it except it would be nice if it were a little more automated in the way file paths etc.
I can't figure out how to pass files into "run shell script". Maybe I'm missing something.
Anyway I'm trying to run
/Users/dara/Web/bin/pdfcombine\ Folder/pdfcombine /path/to/my/file.pdf /path/to/my/file2.pdf -o final.pdf
Basically, I want to select the files >>> then pass the file paths to the above script >> then run.
Can anyone help me?
----
it's a crazy world
LunaC
Offline
Well, I know the shell script would need POSIX paths to the files, but it probably won't receive them that way; I think you'd have to send the paths through an AppleScript to convert them, and at that point, you could just run the shell script from inside the AppleScript too.
After your files are choose:
Applescript:
on run {input, parameters}
set command to "/Users/dara/Web/bin/pdfcombine\\ Folder/pdfcombine "
repeat with thisItem in input
set command to command & quoted form of POSIX path of thisItem & space
end repeat
do shell script command & "-o final.pdf"
end run
Edit: Actually, the shell script does receive a list of POSIX paths. I'll try something else then… (FYI: http://developer.mabwebdesign.com/pdfcombine.html)
Edit: It doesn't use stdin…
Edit: Ok, use this shell script after you select the files:
[code]/Users/dara/Web/bin/pdfcombine\ Folder/pdfcombine "$@" -o /path/to/final.pdf[/code]
You should pass input as arguments (that's the "$@").
Offline
That works perfectly! Thanks.
----
it's a crazy world
LunaC
Offline