Send multiple SMS and MMS via Mail or iPhone Mail

Dec 12, '07 07:30:00AM

Contributed by: solipsism

Using Teleflip (a free service with sign-up; Wikipedia entry), you can send SMS and MMS messages via any email client. This blog post contains AppleScript code that will parse mobile numbers in your Address Book, and add them as email addresses in a 1234567890@teleflip.com format. Here's the source (robg: with permission of the author) in case the blog post ever vanishes:

tell application "Address Book"
	repeat with this_person in every person
			set the_number to ""
			repeat with i from 1 to the count of phone in this_person
				if label of phone [i] of this_person as string is "Mobile" then
					set the_number to value of phone [i] of this_person as string
				end if
			end repeat
			if the_number is not "" then
				set isAlreadySet to "0"
				repeat with i from 1 to the count of email in this_person
					if (value of email [i] of this_person as string) ends with "@teleflip.com" then
						set isAlreadySet to "1"
					end if
				end repeat
				if isAlreadySet is "0" then
					make new email at end of emails of this_person with properties {label:"other", value:my stripSymbolsAddEmail(the_number)}
				end if
			end if
		end repeat
	end tell

	on stripSymbolsAddEmail(inputText)
		set theSymbols to "().- "

		set prevTids to AppleScript's text item delimiters
		repeat with i in theSymbols
			set AppleScript's text item delimiters to i
			set inputText to inputText's text items
			set AppleScript's text item delimiters to prevTids
			set inputText to inputText as text
		end repeat
		if character 1 of inputText is not "1" then
			set inputText to ("1" & inputText)
		end if
		set inputText to (inputText & "@teleflip.com")
		inputText
	end stripSymbolsAddEmail
	-- thanks to http://applescriptsourcebook.com/viewtopic.php?pid=47366 for this part!
Using the script, you can send SMS and MMS messages to multiple contacts from your Mac or iPhone's Mail with ease. If you don't wish to use Teleflip, and you know the carriers for your contacts, then you can use these email address suffixes: [robg adds: I haven't tested this one.]

Comments (10)


Mac OS X Hints
http://hints.macworld.com/article.php?story=20071129131610346