Script issues under 10.12.2
Script issues under 10.12.2
- Subject: Script issues under 10.12.2
- From: "@lbutlr" <email@hidden>
- Date: Sat, 17 Dec 2016 12:20:02 -0700
I've been running the following script for several years, but it is breaking under macOS 10.12.2
#!/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
.signature and .mail_signature are set correctly, but when I run the script I get output like this form the embedded AppleScript:
Aren't you a little short for a stormtrooper?". (-10006)gnature "Fortune" to "—
or
In the words of one of the founding Igors: 'We belong dead? Ecthcutheune" to "--
me? Where doeth it thay \"we\"?'". (-10006)
If I add
echo $MYSIG
right after the assignment, it looks fine:
\"How good bad music and bad reasons sound when we march against an enemy.\" - Friedrich Nietzsche
And then I get the error from eh AppleScript:
\"How good bad music and bad reasons sound when we march against anrtune" to "--
enemy.\" - Friedrich Nietzsche". (-10006)
(It is possible this started earlier, as early as 10.12, as I've not been running the script on this machine).
--
Don't congratulate yourself too much, or berate yourself either. You
choices are half chance; so are everybody else's.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden