Skip to content

Instantly share code, notes, and snippets.

@fanaugen
Last active April 28, 2024 11:13
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fanaugen/1789927 to your computer and use it in GitHub Desktop.
Save fanaugen/1789927 to your computer and use it in GitHub Desktop.
Automator workflow to batch-convert MS Word documents (.doc, .docx) into PDF using Apple Pages
(*
* embed this applescript into an Automator workflow to batch-convert
* MS Word documents (.doc, .docx) into PDF using Apple Pages.
*)
on run {input, parameters}
tell application "Pages"
activate
repeat with doc in input
tell application "Finder"
set fname to name of (info for doc)
set thePath to (container of doc) as alias as text
set newFile to (thePath & fname & ".pdf")
end tell
try
open doc
set thisDoc to front document
save thisDoc as "SLDocumentTypePDF" in newFile
close thisDoc saving no
on error
display dialog "Some problem occurred.
File " & fname & "
could not be saved as PDF."
end try
end repeat
end tell
return input
end run
@flohma
Copy link

flohma commented Dec 2, 2023

Hey, this is a great workflow. I've been trying to adapt it to convert .doc to .pages but couldn't get it to do that (I get the error message every time). What do I have to put instead of "SLDocumentTypePDF" if I want to convert to .pages? Thanks for your help!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment