Update to Encrypting PDF with PDFPen
Slight update to the automatically encrypt PDF's with PDFPen. Updated to select the file and encrypt using PDFPen.
Here is the script which can also be found on github
set this_file to choose file set label to "PDFName" --this is the Name: in Keychain change for whatever you use set Qlabel to quoted form of label set t to do shell script "security 2>&1 find-generic-password -gl " & Qlabel set text item delimiters to "\"" -- Get Password set tlst to every text item of t set pw to item 2 of tlst tell application "PDFpenPro 6" open this_file save document 1 encrypt using AES256 password pw quit end tell