open and then 'save as' group of files in WORD

The problem I’m having is I have a whole bunch of old MS Word files which need to be updated to the current version of Word. What would fit the bill perfectly is this…
1.) There are two folders ‘in’ and ‘out’. The folder ‘in’ has a bunch of old MS Word files.
2.) I drag the folder ‘in’ over a compiled applescript which then invokes MS word to:
2a.) open the file.
2b.) do as save as to the ‘out’ folder
2c.) close the file.
(for each file in the ‘in’ folder.

I appreciate any help in this matter that happens to come my way!


keith :lol:

Save this script as an app then drag and drop a folder full of old formatted Word files (all the files must have the “.doc” extension–look elsewhere on this board for info on batch adding extensions if you need help with that). The script will create a new folder in the same location as the source folder with the same name and the suffix “_converted” and then open every old file and perform a Save As… to the current Word format in the new converted folder:


The only gotcha to the above script is that Word X is still limited to file names of no more than 31 characters (including the “.doc” extension) so make sure your file names are not longer than that. The script below can help but you may not like the way it truncates names (it looks at every file name, if the name is longer than 31 chars, it sets the file name to the last 31 chars).


I got the script compiled and am able to execute it OK, but there seems to be one small glitch. If the Source folder is empty, the script executes to completion, creates the output file and things work as expected. When the script encounters its first target for the ‘save as’ - it opens the file OK - then returns as Run-time error 4172, path not found. It appears to be when it is saving the file. I debuged it an the path looked OK but since I don’t know what I’m doing I can’t really tell. The debug looks like
Sub TmpDDE ()
ChangeFileOpenDirectory _
“whatitis:Users:keith:dataconversionstuff:samplefolderwithworddocs copy_converted:”
End Sub
The ChangeFileOpenDirectory line is highlighted in yellow. The referenced folder does exist.

By the way, I really appreciate the script. I should be able to figure this out on my own, but as of yet don’t know applescript.

thanks again for any inputs are greatly appreciated…


You’re running into a variation of what I detailed above. Microsoft Office is very picky about file names (and, by extension, folder names). I think you’ll find it you limit your folder names (and this goes for all folders in the path) to 31 characters or less, the script will run without a hitch. So, try moving your folder “samplefolderwithworddocs copy” to the desktop, rename it “sample” and drag and drop that folder on the script applet. Now your new folder path will be:


and Office shouldn’t balk.


OK, I’m tracking with you now! Just tried it out and it works great… THANKS! This is going to save me from doing lots of grundge work!!! :smiley:

I am finally getting ready to move to OSX and abandon many of my favorite programs. Is there a way to move Word Perfect files to Word in a similar way? Additional problems are : none of the files even have traditional pc style names (without spaces), let alone “.doc”; I am a rank beginner at Applescript, and feel like I’m reading Russian when I look at your script. Am I safe just to copy, paste and run?

I would also like to save my Global Village fax files in a format that I can bring to OS X. (PDF?)

In both cases, I have probably 7 years worth of files, which I’d sooner carry forward and have, rather than sort through.

Can you help me?



I don’t think Word X has a filter for reading WordPerfect files directly. There are third-party apps that will do conversions (perhaps even AppleWorks) but for the most part, you’ll need to spend some extra cash to get a conversion app. Are you using WordPerfect on a Mac? Does it have an option for Save As… to Word format or even RTF? That might be a good start and may even be scriptable.


Thanks for your reply. Yes, my Word Perfect for Mac (9.0) can save as Word 6.0 and RTF. (I don’t really know what RTF does.)

Do you think it’s scriptable to save 100s of files in various folders, with inconsistent names? For someone with NO AppleScript experience?



RTF is Rich Text Format and is the base format for Word (as well as TextEdit and many other apps).

I’m not familiar with WP for Mac but it may be scriptable (anyone?) and if it is, it might not be too bad to create a script to walk your folders, open each file, clean the name, and save as Word but you’ll need some hand holding and I’m sure there are plenty of kind souls here that will be willing to help.

OT: It makes me a sad to see another user giving up a fine platform like WP to “upgrade” to Word.