Using Hazel or AppleScript to Convert Word to PDF

applescriptfile conversionms officepdf

I use Hazel to sort and rename files. I would like to use Hazel to automatically convert Word docs to PDF. I think this best way to do this is with AppleScript. I have searched extensively online, but have been unable to find an AppleScript that works for me.

Does any have an AppleScript that will simple convert the Word file (doc and docx) to PDF? Or is there an alternative way to do it with Hazel?

Best Answer

This AppleScript should do what you want:

https://discussions.apple.com/message/15180576#15180576

You would need to have Word running, however, for this to work. It's not my code but I just tried it out as a service in Automator with 10.9 and Office 2011 and it works both with a single and multiple Word docs.

I suppose using the actual Word app is the only way to ensure correct layout but using a command-line Word-to-PDF converter could be done, too.