• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Setting signatures in Mail.app from osascript
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Setting signatures in Mail.app from osascript


  • Subject: Setting signatures in Mail.app from osascript
  • From: LuKreme <email@hidden>
  • Date: Tue, 8 Apr 2008 04:45:26 -0600

I have the following shell script:

osascript \
-e "if ((do shell script \"ps -c -U user | awk '/Mail/{print $4}'\") = \"Mail\") then" \
-e " set fortune to do shell script \"/opt/local/bin/fortune /Users/ user/mysigs\"" \
-e " tell application \"Mail\"" \
-e " set content of signature \"Fortune\" to \"-- \" & return & fortune" \
-e " end tell" \
-e "end if"


Which when run, appears to do nothing at all. That is, the contents of the signature named "Fortune" do not change. If I run the following from Script Editor:

if ((do shell script "ps -c -U user | awk '/Mail/{print $4}'") = "Mail") then
set fortune to do shell script "/opt/local/bin/fortune /Users/user/ mysigs"
tell application "Mail"
set content of signature "Fortune" to "-- " & return & fortune
end tell
end if


It works perfectly, changing the signature every time the script runs.

I've looked over the two numerous times and even repasted the SE version into the shell script and reapplied the "'s and -e's and such. I am stumped.

--
Against stupidity the gods themselves contend in vain.

_______________________________________________
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
  • Follow-Ups:
    • Re: Setting signatures in Mail.app from osascript
      • From: LuKreme <email@hidden>
  • Prev by Date: Re: One Finder and one iTunes Question?
  • Next by Date: Re: do shell script hanging
  • Previous by thread: Re: One Finder and one iTunes Question?
  • Next by thread: Re: Setting signatures in Mail.app from osascript
  • Index(es):
    • Date
    • Thread