AppleScript Error Message
You want folders… I got your folders right here…
To use, select a folder and run the script.
Notes: I used Word to open each document as that made it easier to match file with container, which should also reduce issues with how long it takes to open multiple files. There isn't any error correction so if your selection isn't a folder….
-- Save all 'doc' within folder structure as 'docx' in same folder
-- Create list of each 'doc' file and its containing folder
set fKind to &quot;Microsoft Word 97 - 2004 document&quot;
tell application &quot;Finder&quot;
    set topFolder to selection as alias
    set refList to a reference to entire contents of topFolder
    
    set bList to {}
    set docList to every item of refList whose kind is fKind
    repeat with ea in docList
        set c to container of ea as alias as text
        copy {name of ea, c} to end of bList
    end repeat
end tell

-- Open each 'doc', save in same folder, close doc
tell application &quot;Microsoft Word&quot;
    set oldDefaultPath to get default file path file path type documents path
    
    repeat with b in bList
        -- b in bList example {&quot;filename.doc&quot;, &quot;Mac:Users:username:Documents:docFolder1:deepFolder2:&quot;}
        set sName to first item of b
        set sPath to second item of b
        set default file path file path type documents path path (sPath)
        
        open sPath &amp; sName
        save as document sName file name (sName &amp; &quot;x&quot;) file format format
        close document 1 saving no
        
    end repeat
    set default file path file path type documents path path oldDefaultPath
end tell