Signed application cannot be opened once downloaded - ("unidentified developer") error
When you downloaded apps with Safari an extended property is set on the file to mark is as quarantined. Another extended property is set to save the URL you've downloaded the file from.

Depending on your security settings you will be prompted the first time trying to start the downloaded application. You will be informed that you have downloaded the program, the URL and - depending on your settings - be allowed to bypass the prompt and run the program.

You can remove the attribute manually to allow you to script these downloads. Run the following command in Terminal.app:

xattr -d com.apple.quarantine path/to/file/filename