Want to highlight a helpful answer? Upvote!

Did someone help you, or did an answer or User Tip resolve your issue? Upvote by selecting the upvote arrow. Your feedback helps others! Learn more about when to upvote >

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

Use Automator to save to PDF Office 365 Word documents

This is a reply to this post :

https://discussions.apple.com/thread/250067807?answerId=250118986022#250118986022


I use the following modified automator AppleScript service to batch convert .docx in PDF with office 365 (January 2022):


this script was written by VikingOSX, I've updated it to match service requirement


property Delim : {".docx", ".doc"}
property PDF : ".pdf"

on run {selected_files, parameters}
	
	set outPDF to {}
	-- replace Word document extensions with PDF, and append to outPDF list
	set {TID, AppleScript's text item delimiters} to {AppleScript's text item delimiters, Delim}
	repeat with afile in selected_files
		copy item 1 of text items of (afile as text) & PDF to the end of outPDF
	end repeat
	set AppleScript's text item delimiters to TID
	
	tell application id "com.microsoft.Word"
		activate
		repeat with i from 1 to count of selected_files
			open (item i of selected_files)
			set theOutputPath to (item i of outPDF)
			-- close access (open for access exportDocument)
			tell active document
				save as it file name theOutputPath file format format PDF
				close saving no
			end tell
		end repeat
	end tell
	return
end run

Posted on Jan 30, 2022 11:28 PM

Reply
Question marked as Best reply

Posted on Jan 31, 2022 5:28 AM

I bookmarked your revision, and I encourage those using Word in current Microsoft 365/Office 2019/2021 for Mac to do so too.

1 reply

Use Automator to save to PDF Office 365 Word documents

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