AlJohri / docx2pdf

MIT License
506 stars 96 forks source link

Use docx2pdf as an automator service #8

Open sabbasabba opened 4 years ago

sabbasabba commented 4 years ago

I myself am not good at coding, but is there a way to make this work as an automator service? I've come across your tool because I'm desperately looking for a simple automator service that converts .docx files to .PDF files. All the solutions I've found don't seem to work anymore. Some are not compatible with Catalina, others require CUPS (not available under Catalina) while others rely on Word-Automator library actions not available anymore. So could I make your solution work in Automator? Manually copying folder paths into Terminal is very cumbersome... Best wishes!

AlJohri commented 4 years ago

Thanks @sabbasabba, I actually had another request for this as well. It's definitely something I'd like to look into.

JanusChoi commented 2 years ago

I think it's easy that you could add a service in Mac Automator and then call a shell script like:

#!/bin/bash
# set -e

# get full file path and name
filename=$1
echo ${filename}  >> ~/data/word2pdf.log

# 执行python
/usr/bin/python /your_python_filepath/word2pdf.py ${filename}

echo "succeed......" >> ~/data/word2pdf.log

Then you could right click on a file then choose quick action to complete the workflow.