Apple Event: May 7th at 7 am PT

Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

How to convert boat load of '97 word .doc to .docx using Automator?

Greetings Mac Community,

Need some help here. I am a new user to Mac and Leopard. I have successfully transfered folders containing many documents in .doc format created by office '97 to my Mac. I would like to save these documents or that is to say convert these many .doc documents into the .docx format to store and have on my Mac. How can I do this WITHOUT opening every single .doc document? Is there some action I can do that would automatically convert every one of these .doc documents in a folder to the .docx format? Could I use the automator here? And how? Does anyone have the command/script to do this? Where I could simply drag the folder to another folder and presto?

I do have one folder using the automator where any image I drag to it is converted to a JPEG image. Is it possible to drag a .doc file to a folder and have it convert to a .docx file?

Thanks.

Mac Pro Single 2.8 GHz Quad 4 GB Memory, Mac OS X (10.5.6), Sony 34" XBR960 HDTV as Monitor--16GB ipod Touch 2.2

Posted on Mar 3, 2009 5:51 PM

Reply
19 replies

Jan 5, 2014 1:35 PM in response to pjdube

Thanks, pjdube!


The script you supplied works very well to convert .doc or .docx to pdf. I tried to modify it to convert .doc to .docx, but it's not quite working. (So far it just opens the file in Word and sits there, thinking it's done...)


All I did was change the paramaters where you had "pdf" to "docx," making sure automator liked the syntax. What am I missing?


Here's my ammended workflow.


Thank you for the script, and for any suggestions on how to make mine work!


~josh.




property theList : {"doc"}


on run {input, parameters}


set output to {}


tell application "Microsoft Word" to set theOldDefaultPath to get default file path file path type documents path


repeat with x in input


try


set theDoc to contents of x


tell application "Finder"


set theFilePath to container of theDoc as text




set ext to name extension of theDoc


if ext is in theList then


set theName to name of theDoc


copy length of theName to l


copy length of ext to exl




set n to l - exl - 1


copy characters 1 through n of theName as string to theFilename




set theFilename to theFilename & ".docx"




tell application "Microsoft Word"


set default file path file path type documents path path theFilePath


open theDoc


set theActiveDoc to the active document


save as theActiveDoc file format docx file name theFilename


copy (POSIX path of (theFilePath & theFilename as string)) to end of output


close theActiveDoc


end tell


end if


end tell


end try


end repeat


tell application "Microsoft Word" to set default file path file path type documents path path theOldDefaultPath






return output


end run

Jun 5, 2014 6:21 AM in response to feldyviol

I'm in the same boat (forgive the pun). Did you manage to convert to docx in the meanwhile?


[warning: newbie] I think the line where you change 'pdf' to 'docx' should read:


save astheActiveDocfile formatformat documentfile nametheFilename


Then again, maybe not.


In any case, I get a 'null' error when I try pjdube's original script (unchanged).


Thanks for any update regarding conversion to docx!

How to convert boat load of '97 word .doc to .docx using Automator?

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.