Re: Changes in osascript?
Re: Changes in osascript?
- Subject: Re: Changes in osascript?
- From: LuKreme <email@hidden>
- Date: Sat, 14 Feb 2009 02:49:31 -0700
On 28-Jan-2009, at 07:10, LuKreme wrote:
if ps -U"$USER" -co command | grep Mail; then
osascript -e 'tell application "Mail" to set content of signature
"Fortune" to \
"-- " & return & (do shell script "/opt/local/bin/fortune /Users/
syth/mysigs")'
fi
The only problem I see with this is that the if conditional
generates "Mail" when run from the command line. I've reënabled it
as a LaunchAgent and I get
28-Jan-09 06:52:28 com.kreme.home.randsig[9845] Mail
In the Console ever time it fires. Small price to pay, perhaps,
though I'd prefer to eliminate it.
I managed to fix this:
#!/bin/sh
MAIL=`ps -U"$USER" -co command | grep Mail`
if [ $MAIL ]; then
osascript -e 'tell application "Mail" to set content of signature
"Fortune" to "-- " & return & (do shell script "/opt/local/bin/
fortune /Users/syth/mysigs")'
fi
No messages get logged to Console wether Mail is running or not.
--
"you'd think you could trust a horde of hungarian barbarians"
_______________________________________________
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