[robg adds: I have not had the time to test this one...]
Here's how to do it:
- Get txt2pdbdoc. In the Terminal, cd to the txt2pdbdoc directory and type ./configure, make, then make install.
- Get xpdf. In the xpdf directory, open the aconf2.h file and comment out (with double slashes) all of the lines that begin with "#". There's a bug in the 10.2 version of gcc that this avoids. Next, still in the xpdf directory, type ./configure, make, then make install.
- Open up Script Editor, and enter the following:
Replace "username" with your UNIX username.on open these_items repeat with aFile in these_items set inputFile to (unix_path(aFile)) --get new file name repeat display dialog "Enter title of document:" default answer "Title" set newName to the text returned of the result if newName is not "" then exit repeat end repeat --convert to text do shell script "pdftotext " & inputFile & ¬ " /Users/username/Desktop/" & unix_path(newName) & ".txt" --convert to pdb do shell script "txt2pdbdoc \"" & newName & ¬ "\" /Users/mdr/Desktop/" & unix_path(newName) & ¬ ".txt" & " /Users/username/Desktop/" & unix_path(newName) & ".pdb" --delete text file do shell script "rm /Users/username/Desktop/" & ¬ unix_path(newName) & ".txt" --delete print spool file do shell script "rm " & inputFile end repeat end open on unix_path(mac_path) set unixpath to (POSIX path of mac_path) set chars to every character of unixpath repeat with i from 1 to length of chars if " !$&\"'*(){[|;<>?~` \\" contains ¬ (item i of chars as text) then set item i of chars to "\\" & (item i of chars as text) end if end repeat return every item of chars as string end unix_path
- Save this as a compiled script called "->PDB" in ~/Library/PDF Services
Thanks to those who contributed the hints on unix_path and PDF Workflow!

