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
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.
Setup
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
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
#!/bin/bash # ahbusinesstechnology # 2015-03-18 # Convert annoying DOCX into PDFs with a right-click # Run this as an Automator Service ###### SCRIPT ####### do # Get the full file PATH without the extension filepathWithoutExtension="${f%.*}" # 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 done |
9. Choose File > Save

10. Your workflow will now appear when right-clicking files