Email to text message

Is it possible to create an apple script that will take email messages selected by a mac mail rules action, capture the body of the email or part of it, then send the text to a cell phone via text message, specifically SprintPCS texting?

Thanks for any help.

Model: iMac
Browser: Firefox 2.0.0.14
Operating System: Mac OS X (10.5)

Hi chasford,

Yes, it is possible to just capture the body (or parts of it) of an incoming eMail message in Apple Mail using an AppleScript attached to a mail rule:


using terms from application "Mail"
	on perform mail action with messages matchmsgs for rule therule
		repeat with msg in matchmsgs
			tell application "Mail"
				set msgcont to content of msg
			end tell
		end repeat
	end perform mail action with messages
end using terms from

And there are several possibilities to send SMS via AppleScript. But as I am from Germany, I simply don’t know about this specific SprintPCS service.

Nevertheless I guess that your task can be automated with out beloved scripting language :wink:

This is a Mail rule script that I use to text the name of the email sender to me using iChat:


using terms from application "Mail"
	on perform mail action with messages theMessages for rule theRule
		repeat with eachMessage in theMessages
			tell application "Mail"
				set senderName to (extract name from sender of eachMessage)
				tell application "System Events"
					set processList to (name of every process whose background only is false)
					if processList contains "iChat" then
						tell application "iChat"
							activate
							send senderName to account "+13335557777" of service 1 -- your phone number here
						end tell
						set visible of application process "iChat" to false
					else
						tell application "iChat"
							activate
							delay 3
							send senderName to account "+13335557777" of service 1 -- your phone number here
						end tell
						set visible of application process "iChat" to false
					end if
				end tell
			end tell
		end repeat
	end perform mail action with messages
end using terms from