Pick of the Week - Nov 10 [Show all picks]
Path Finder 5 - A feature-laden Finder replacement
Submit Hint Search The Forums LinksStatsPollsFAQHeadlinesRSS
12,000 hints and counting!


Click here to return to the 'Here it is as a plug-in' hint
The following comments are owned by whomever posted them. This site is not responsible for what they say.
Here it is as a plug-in
Authored by: rickybuchanan on Fri, Dec 14 2007 at 12:07AM PST
I use a service in Australia - messagenet.net.au - which requires the same mobilenumber@their.server format and hacked together a plugin to do exactly what you described. Feel free to use/modify/etc.:


using terms from application "Address Book"
	on action property
		return "phone"
	end action property
	
	on action title for aPerson with aPhone
		return "SMS With MessageNet"
	end action title
	
	on should enable action for aPerson with aPhone
		return true
	end should enable action
	
	on perform action for aPerson with aPhone
		set fullName to (name of aPerson as string)
		
		set telephone to ""
		if value of aPhone is not missing value then set telephone to value of aPhone
		
		-- TODO Remove any non-number characters from the string
		-- Hack for now: Remove spaces
		set AppleScript's text item delimiters to " "
		set telephone to telephone's text items
		set AppleScript's text item delimiters to ""
		set telephone to "" & telephone
		set AppleScript's text item delimiters to {""}
		
		set emailAddress to telephone & "@messagenet.com.au"
		
		-- display dialog "'" & fullName & "' - '" & emailAddress & "'"
		
		tell application "Mail"
			set newMessage to make new outgoing message with properties {subject:fullName & " <" & emailAddress & ">", content:""}
			tell newMessage
				make new to recipient at end of to recipients with properties {address:emailAddress, name:fullName}
				set visible to true
			end tell
			activate
		end tell
	end perform action
end using terms from

Ricky

---
[Please excuse mistakes/brevity, typed via on-screen keyboard due to disability]

[ Reply to This | # ]