Mass File Conversion (to PDF)?

Ca
Carradee
Posts: 422
Joined: Fri Mar 27, 2009 11:38 am
Platform: Mac
Contact:

Sat Sep 12, 2009 6:28 pm Post

I want to convert a load of MHT files on my comp to PDF files, but is there any way I can do that easily instead of having to individually open each file and go through the print to file option?

Thanks!
Wanna hydroplane?
--My brother (while driving)

User avatar
Jot
Posts: 180
Joined: Wed Oct 11, 2006 7:35 pm
Platform: Mac, Win + iOS

Sat Sep 12, 2009 10:06 pm Post

If you've got access to a windows machine (or use Parallels) you could try something like PDF995. It does batching conversion. Acrobat will also do this, but you have to script it yourself (irk).

I want to do exactly the same thing. I need to convert hundreds of docs, text, rtfs etc to PDF to read on my iPhone (I tried to use Calibre to covert to epub - it does batches - but the resulting files are unreadable on the device). I haven't managed to find anything at reasonable cost (or even unreasonable for that matter) for the mac yet.
J

User avatar
Jaysen
Posts: 6227
Joined: Mon Dec 17, 2007 4:00 am
Platform: Mac + Windows
Location: East-Be-Jesus-Nowhere SC, USA

Sat Sep 12, 2009 11:24 pm Post

Shouldn't be to tough to create an apple script/automator to do the convert to pdf. I might take a look into it later this week.
Jaysen

I have a wife and 2 kids that I can only attribute to a wiggle, a giggle, and the realization that she was out of my league so I might as well be happy with her as a friend. 26 years marriage later, I can't imagine life without her. -Me 10/7/09

ImageImage

Ca
Carradee
Posts: 422
Joined: Fri Mar 27, 2009 11:38 am
Platform: Mac
Contact:

Sat Sep 12, 2009 11:35 pm Post

Jaysen wrote:Shouldn't be to tough to create an apple script/automator to do the convert to pdf. I might take a look into it later this week.


*perks up* Really? :D

I've been thinking that it shouldn't be hard, but I can't figure out how to do it.

Please do, if you get a chance. *puppy dog eyes*
Wanna hydroplane?
--My brother (while driving)

Ca
Carradee
Posts: 422
Joined: Fri Mar 27, 2009 11:38 am
Platform: Mac
Contact:

Sun Oct 04, 2009 2:25 am Post

*peeks in*

*looks at the mostly empty thread*

I only have an Apple. My friend would likely let me borrow her Windows laptop to convert things, but I would like something that'll work on my comp, because it's something I'd use fairly frequently.

Anyone? Any other suggestions or ideas? I found this script, but I'm still trying to figure out how to work it.

:cry:
Wanna hydroplane?
--My brother (while driving)

Ap
Apollo16
Posts: 198
Joined: Sun Dec 07, 2008 7:23 pm

Sun Oct 04, 2009 3:26 am Post

Graphic Converter can do batch conversions to pdf of lots of different file types. I do not know if it can open MHT files. If it can, you are golden.

Apollo16

si
signinstranger
Posts: 268
Joined: Sun Oct 21, 2007 4:15 pm
Platform: Mac
Location: Germany

Sun Oct 04, 2009 8:50 am Post

Carradee wrote: I found this script, but I'm still trying to figure out how to work it.

You have to save the script (which does not work with folders or RTFD files) as an Application first. There's an option for that in the save dialog in Apple's Script Editor. Once you've created the App, you can simply drag'n drop multiple files on its icon. The PDF files will be created in the same location as the original files.

Ca
Carradee
Posts: 422
Joined: Fri Mar 27, 2009 11:38 am
Platform: Mac
Contact:

Mon Oct 05, 2009 11:27 am Post

signinstranger wrote:
Carradee wrote: I found this script, but I'm still trying to figure out how to work it.

You have to save the script (which does not work with folders or RTFD files) as an Application first. There's an option for that in the save dialog in Apple's Script Editor. Once you've created the App, you can simply drag'n drop multiple files on its icon. The PDF files will be created in the same location as the original files.


Did that. The conversion's messed up.
Wanna hydroplane?
--My brother (while driving)

si
signinstranger
Posts: 268
Joined: Sun Oct 21, 2007 4:15 pm
Platform: Mac
Location: Germany

Mon Oct 05, 2009 8:06 pm Post

Unfortunately, you're right. :( I've added Apple's textutil to the script, which
should improve the conversion of HTML files. There's also a problem with certain filenames. If your documents are mostly websites, that could be the issue.

Ca
Carradee
Posts: 422
Joined: Fri Mar 27, 2009 11:38 am
Platform: Mac
Contact:

Mon Oct 05, 2009 9:57 pm Post

signinstranger wrote:Unfortunately, you're right. :( I've added Apple's textutil to the script, which
should improve the conversion of HTML files. There's also a problem with certain filenames. If your documents are mostly websites, that could be the issue.


Still doesn't work. :(

(I've attached the resultant converted PDF if it helps trigger any thoughts.)

Maybe there's a way to convert MHT to something else as an intermediate before going to PDF? *off to hunt*
Attachments
Christianity and slavery - Wikipedia, the free encyclopedia.mht.pdf
PDF
(784.39 KiB) Downloaded 1473 times
Wanna hydroplane?
--My brother (while driving)

User avatar
xiamenese
Posts: 4318
Joined: Mon Jan 29, 2007 1:32 am
Platform: Mac
Location: London or Exeter, UK.

Tue Oct 06, 2009 12:16 am Post

Carradee, I have no knowledge and experience of this ... indeed I don't even know what an MHT file is, but one thing the Mac is brilliant at is printing anything to PDF. Could you not use automator -- again something I haven't done personally, but some of the greater geeks on this forum might be able to help you with -- to create a folder that would automatically print to PDF any file you drop into it, on the basis of an app that does read your MHTs as ordinary text rather than binary?

Just a suggestion.

Mark
The Scrivenato sometimes known as Mr X.
iMac 27" (late 2015) 10.15.4, 24GB RAM, 512GB SSID
MBP17" (late 2011) 10.13.6, 16GB RAM, 2TB SSID
2017 iPad, iPadOS 13.3, 128GB, Apple Pencil
Scrivener, Scapple, Nisus Writer Pro, Bookends …

User avatar
Jaysen
Posts: 6227
Joined: Mon Dec 17, 2007 4:00 am
Platform: Mac + Windows
Location: East-Be-Jesus-Nowhere SC, USA

Tue Oct 06, 2009 1:01 am Post

The apple script print interface makes it a tad "tougher" than this. At least the part that I can figure out with only online docs. Still thinking about it though.
Jaysen

I have a wife and 2 kids that I can only attribute to a wiggle, a giggle, and the realization that she was out of my league so I might as well be happy with her as a friend. 26 years marriage later, I can't imagine life without her. -Me 10/7/09

ImageImage

Ca
Carradee
Posts: 422
Joined: Fri Mar 27, 2009 11:38 am
Platform: Mac
Contact:

Tue Oct 06, 2009 1:35 am Post

xiamenese wrote:Could you not use automator


I've poked at my problem with Automator, the OS's print function, and a pointy stick, but I can't figure out how to mesh them.

*scratches head* There has got to be some way to do this.
Wanna hydroplane?
--My brother (while driving)

User avatar
xiamenese
Posts: 4318
Joined: Mon Jan 29, 2007 1:32 am
Platform: Mac
Location: London or Exeter, UK.

Sat Oct 10, 2009 1:30 am Post

Carradee, I just saw this in the OmniGraffle forum, where someone was asking how to produce batch PDFs from about fifty OmniGraffle files. I don't know whether you could use the script Joel gives as a basis for rolling your own for the files that concern you.

:)

Mark
This is a very old AppleScript, so it may take some tweaking, but it will take a number of selected .graffle files in the Finder and export them to PDF:

Code: Select all

Code:
tell application "Finder"
   repeat with theFile in selection as list
      my convert_to_pdf(theFile, "pdf")
   end repeat
end tell

on convert_to_pdf(graffleAlias, fileType)
   tell application "OmniGraffle Professional 5"
      open graffleAlias
      set rawPath to path of document 1 as string
   end tell
   searchReplace(rawPath, ".graffle", "")
   set rawPath to the result
   tell application "OmniGraffle Professional 5"
      set myPath to POSIX path of (rawPath & "." & fileType)
      --display dialog myPath
      save first document in myPath as fileType
      --close first document
   end tell
end convert_to_pdf

on searchReplace(theText, SearchString, ReplaceString)
   set OldDelims to AppleScript's text item delimiters
   set AppleScript's text item delimiters to SearchString
   set newText to text items of theText
   set AppleScript's text item delimiters to ReplaceString
   set newText to newText as text
   set AppleScript's text item delimiters to OldDelims
   return newText
end searchReplace

Hope it helps,
__________________
"Vroom! Vroom!!"
The Scrivenato sometimes known as Mr X.
iMac 27" (late 2015) 10.15.4, 24GB RAM, 512GB SSID
MBP17" (late 2011) 10.13.6, 16GB RAM, 2TB SSID
2017 iPad, iPadOS 13.3, 128GB, Apple Pencil
Scrivener, Scapple, Nisus Writer Pro, Bookends …

User avatar
Jaysen
Posts: 6227
Joined: Mon Dec 17, 2007 4:00 am
Platform: Mac + Windows
Location: East-Be-Jesus-Nowhere SC, USA

Sat Oct 10, 2009 1:33 am Post

This will work if
1. the app that you open the file with supports save as PDF.
2. the app has scripted the save as dialog a bit.

So this might be your best bet.
Jaysen

I have a wife and 2 kids that I can only attribute to a wiggle, a giggle, and the realization that she was out of my league so I might as well be happy with her as a friend. 26 years marriage later, I can't imagine life without her. -Me 10/7/09

ImageImage