I regularly need to decrypt a gpg-encrypted file (always the same) to simply view it in TextEdit. I have a very simple shell script for that. It looks like this:
#!/bin/sh outfile=`mktemp -t $$` # Temporary file name gpg --output $outfile --decrypt /path/to/file.gpg open -a TextEdit $outfile sleep 1 rm $outfile
When run from the terminal, all goes well. GPG asks for my passphrase in a pop-up window, TextEdit comes up, the temp file is deleted and all is great. Not so in Automator. I select "Run Shell Script", ignore the shell script input, paste the contents of the script (except for the first line). TextEdit pops up with a blank file and GPG never asks for the passphrase. I tried using the full path to GPG but that didn't do it. I know virtually nothing of Automator actions so the problem surely comes from me.
Any help appreciated!