I have a launch agent that I created several years ago to set a random signature both in a .signature and in Mail.app. It does nothing complicated and has hummed along through several OS X versions. However, I see that recently every time it runs there is an error logged into the console:
12/07/15 08:52:36.903 com.apple.xpc.launchd: (local.home.randsig) Service exited with abnormal code: 1
The script is not at all complicated, and it runs out of my home folder (#HOME/bin/randsig), but I suspect I am running into a sandboxing issue.
#!/bin/bash SIGHOME="$HOME/.signature" $HOME/bin/fortune $HOME/mysigs > $SIGHOME MAIL=`ps -U"$USER" -co command | grep "\bMail\b"` if [ "$MAIL" ]; then cat $SIGHOME | sed -e 's/"/\\"/g' > $HOME/.mail_signature MYSIG="$(<$HOME/.mail_signature)" osascript <<EOF tell application "Mail" to set content of signature "Fortune" to "-- " & return & "$MYSIG" EOF fi
The error doesn't prevent the script from running, but since it runs every 12 seconds, the errors do make looking for other things in console more of a problem.
I did see this discussion, but in my case it doesn't help me.