QUICK TIP - Convert DOCX to PDF With 1 Click
- 1. QUICK TIP - Most Useful .htaccess Tricks for WordPress
- 2. QUICK TIP - How to Join and Earn From Brave Ads
- 3. QUICK TIP - PHP Regex Cheat Sheet
- 4. QUICK TIP - Bypass Google Drive Download Limit and Fix “Sorry you can’t view or download this file” Error
Microsoft Office for OS X is usually very sluggish and slow. This is one reason I don’t like working with DOCs or DOCXs in OS X. Yes, you can easily view the document using QuickLook (pressing the Space bar while the file is highlighted), but if you actually want to open the file and manipulate it, you need to either buy Office, or get an open source alternative.
I hate waiting for Microsoft Word to load and open the documents, so I made an Automator workflow that converts a Microsoft Word document into a PDF, so I can easily get rid of the DOCX and enjoy using the better-performing Preview app.
The best part is that you don’t need to install an office suite or any other software. The script runs as a service, so you can just right-click a DOCX and choose Convert to PDF.
1. Open Automator
2. Choose Service (or Quick Action in later versions of macOS)
3. Click Choose
4. Choose Files or folders and Finder.app from the pulldown menus labeled Service receives selected
6. Drag Run Shell Script from the left pane into the right pane
7. Choose As Arguments from the pulldown menu labeled Pass Input
8. Paste in the script below
# Convert annoying DOCX into PDFs with a right-click
# Run this as an Automator Service
###### SCRIPT #######
for f in "[email protected]"
# Get the full file PATH without the extension
# Convert the DOCX to HTML, which cupsfilter knows how to turn into a PDF
textutil -convert html -output "$filepathWithoutExtension.html" "$f"
# Convert the file into a PDF
cupsfilter "$filepathWithoutExtension.html" > "$filepathWithoutExtension.pdf"
# Remove the original file and the temporary HTML file, leaving only the PDF
rm "$filepathWithoutExtension.html" >/dev/null
9. Choose File > Save
10. Your workflow will now appear when right-clicking files