I've created an Automator Workflow which can take the selected Finder item (being a PDF) and encrypt it using the Apple-provided "Encrypt PDF Documents" action. The problem with this action is it leaves the file buried deep in the /private/var folder structure.
I can add a subsequent action to move the file to a more visible location, however I want to be able to put it back wherever the original file was. Can I do this in Automator?
I tried a set then get of a variable for the filename but the final step to move the file errors with "the chosen folder was not found on this computer". It would seem that it's being given the full original path of the file, which indeed is not a folder.
The intended use of this Workflow is to be used as part of a Hazel action (by stripping off the initial Get Finder Items action). Can anyone tell me how I can solve this problem of encrypting an existing PDF in situ?
Possible options I have thought of include: 1. Figure out how to strip the file name off the variable. 2. Figure out how to encrypt the PDF using AppleScript (and thus making the variable handling much more flexible) 3. Use some other method from within Hazel than Automator/AppleScript.
Please note I am aware of the scripts out there to use PDFPen, but I do not like the fact that PDFPen has to launch just to encrypt a PDF, especially when the OS has the capability built in.
I am something of a novice with both Automator and AppleScript but am a programmer by trade, so any suggestions welcome.