Hmmm.
I ran the code in Terminal but am still getting the message that the app is damaged and should be moved to the trash.