You can make a difference in the Apple Support Community!

When you sign up with your Apple Account, you can provide valuable feedback to other community members by upvoting helpful replies and User Tips.

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

Find and Replace text in batch of Word docs

Please help me find and replace a text string in a batch of Word docs. Is this possible with Shortcuts? My failed attempt could only grab one file and did not find/replace any text. If not Shortcuts, how could I do this with Automator? Thank you!


novice, macbook air 2018, monterey OS, many hours lost and defeated






Big fail with Automator attempt too.




MacBook Air

Posted on Feb 12, 2022 7:10 AM

Reply

Similar questions

5 replies

Feb 15, 2022 4:42 AM in response to Ggreensheep

We are back to my previous Feb 12 reply.


Check if Automator has a Documents Library introduced by Microsoft 365 or either Office 2019/2021 for Mac. If it does, you will need to use the Open Word Document, and the Find and Replace Text in Word documents actions, as shown in that preceding link. The only other means of externally changing content in a Word document would be via AppleScript if Microsoft provides scripting dictionary support for that purpose. No other workflow or scripting solution can do this, other than some incantation of Word basic.


I do not have Word installed, so I cannot create and test an Automator or Shortcuts workflow solution to Find/Replace text in a Word document. None of the scripts that I have posted can perform find/replace in a Word document. Converting the Word document to PDF won't solve batch-changing text in Word documents, and introduces separate programming challenges.



Feb 12, 2022 7:42 PM in response to VikingOSX

VikingOSX, I have been learning from your many helpful posts for days now! Grateful for your succinct and informative replies.

As a workaround, I am using some of your brilliant shell script to open each docx and save as PDFs through Shortcuts. However, I've been unsuccessful with file filtering, moving and closing the files after conversion. Any suggestions on how to make this work? Thank you!





Feb 12, 2022 7:16 AM in response to Ggreensheep

Word documents are a renamed zip container (.docx) containing several XML documents. You will need to open each document in MS Word, and provided Word's AppleScript scripting definitions allow it. programmatically tell Word to find and replace the appropriate strings. Until you do this, nothing in Automator or Shortcuts will solve your find/replace issue to batch process Word documents.

Find and Replace text in batch of Word docs

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