
This little gem (Use double-quotes if you still want variables inside to be expanded and single-quotes if you want it to be taken literally) tucked away deep inside the Noodlesoft Forums came to my rescue! Qpdf: unknown argument /Users/me/Desktop/Transfer/remove encryption/some.pdfĮDIT: To answer my own question, after many hours digging around I finally got it to work with qpdf -decrypt -password=some_password "$1" '/Users/me/Desktop/Transfer/remove encryption' Qpdf: unknown argument /Users/me/Desktop/Transfer/remove As of now I see the following error message in the Hazel logs: The script works as is if I change the name of the folder from remove encryption to remove but I would like this script, and future ones, to work when there is a space in the folder/file name.

Qpdf -decrypt -password=some_password $1 /Users/me/Desktop/Transfer/remove\ encryptionĪnd variations on these with " "s and $s. Qpdf -decrypt -password=some_password $1 /Users/me/Desktop/Transfer/remove encryption

I’m new to scripting and am tearing my hair out after an unsuccessful hour-long search over what must be a super simple and obvious situation. It works if there is no space in the folder name though. I’m trying to get this to work and it does in Terminal using qpdf but for some reason I just can’t get Hazel to play nice with it as the script gets thrown off because of a space in the folder name. I used the same Hazel rule to move the file to the trash after I ran the shell script (this trashed the original encrypted file, leaving the new decrypted file as the sole file left in the folder).
How to open password protected pdf without password mac code#
:max_bytes(150000):strip_icc()/001_password-protect-pdf-4149687-5bff2f3f46e0fb00268a5f8f.jpg)
