• 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
Sending from Mail
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Sending from Mail


  • Subject: Sending from Mail
  • From: LuKreme <email@hidden>
  • Date: Sat, 19 Sep 2009 12:04:59 -0600

OK, after looking at the sample scripts I came up with the following:

property SendAddress : "email@hidden"
property theSubject : "Automated Warning"
property theBody : "Alert: "
property theFrom : "email@hidden"

tell application "Mail"
	set newMessage to make new outgoing message
	tell newMessage
		set subject to theSubject
		set content to theBody
		set visible to true
		set sender to theFrom
		make new to recipient with properties {address:SendAddress}
	end tell
	send newMessage
end tell

Nifty, the message is created. However, I want to get something out of the subject of the message I am going to be replying to.

For example, let's say the message comes from email@hidden with a subject of "Automated Warning: <process> not responding" where <process> can be any of a number of things. The text around <process> is predictable.

I want to fire my AppleScript in reply to that message (easy enough with the Rules in Mail.app) and send an SMS that says "Alert: Process"

How do I get that word out of the original subject? What if the word I want is in the body, still surrounded by predictable text?

--
My biggest problem is that Steve insists on serving PURPLE Kool
	Aid, an I don't like PURPLE <sip sip> Kool Aid.

_______________________________________________
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: Sending from Mail
      • From: Philip Aker <email@hidden>
  • Prev by Date: Re: Mail scripting
  • Next by Date: Re: Speakable Item and SpeechRecognitionServer
  • Previous by thread: Re: Mail scripting
  • Next by thread: Re: Sending from Mail
  • Index(es):
    • Date
    • Thread