Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Click here to return to the 'Bulk convert text files to PDF' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Bulk convert text files to PDF
Authored by: tedw on Jun 08, '11 07:43:01AM
Sorry, there's no cure for that, and I'm pretty sure it's fatal. :-)

'shortness' is only one factor here clarity is also important. You identify the extension using (essentially):

(length of myText) - (offset of "." in ((reverse of text items of myText) as string))
I use:
set my text item delimiters "."
last text item of myText
If you like using cocoa commands for text manipulation, then you're stuck in XCode, though personally for any complex text manips I use the Satimage osax (which has all sorts of text goodies wrapped up in it). text items take some getting used to, but they really simplify some kinds of text operations.

with respect to your other point, you're right, but that's somewhat out of the scope of this script. all this script (unmodified) can do with images is create a pdf for each one fed to it, which isn't all that useful - if you want to create multi-image pdfs then you'd want a different script (and even then, you'd probably have more luck making pdfs straight from preview). Can't do everything...

[ Reply to This | # ]

Bulk convert text files to PDF
Authored by: wallybear on Jun 08, '11 10:16:36AM

Too bad for the cure... :(

You're right, the text delimiters method is clearer; regarding Satimage osaxes they are really interesting, but long ago I promised myself to keep clear from osaxes (I got burned when some osaxes I used in my software stopped working with the next OS X release and found to be no more mantained); what's more, I should force my users to install them.

Ok for the (un)usefulness of converting images, but it was only an example; convert can process lots of different file kinds, and I don't know "a priori" which one I have to put in that list. Why should I limit a functionality given for free?

Regarding the deletion of the temp file when converting from doc/docx, I just found that the "-D" option of convert deletes the input file when finished, so it could be used as an alternative method.

[ Reply to This | # ]