Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the '10.5: Apply data detectors to Safari web pages' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
10.5: Apply data detectors to Safari web pages
Authored by: sohocoke on Sep 30, '08 04:01:30PM
I can't believe how badly Leopard sucks in this respect - why on Earth is the data detector only available in Mail.app, and still not in Safari as of 10.5.5?

As all the iPhone Maps workflows depend on tapping on address fields in Address Book entries, and without any other cross-application workflows involving addresses, I find I need to now create Address book entries a lot. And it's really a pain when I have to fill in each of the fields for a contact, when I know Mail.app data detection can save me a lot of time.

The level of frustration built up to the level where I finally gave up and wrote an Applescript. It took me an evening since Mail scriptability sucked, much longer than the task should deserve, as is the case with AS. But it does the job, albeit crudely. Copy the address details to the clipboard, run the script, wait for a while and in the new viewer's draft mailbox you will have the clipboard content ready for data detection.

(*
create a draft mail message from clipboard contents for data detection - Andy Park
*)

set theContents to the clipboard

tell application "Mail"
	set theSubject to "[datadetect] " & theContents
	set newMessage to make new outgoing message with properties {subject:theSubject, content:theContents & return & return}
	
	set newViewer to make new message viewer
	tell newViewer
		set selected mailboxes to {drafts mailbox}
	end tell
	
end tell
As I am way too sleepy now and too tired of AS, I'd greatly appreciate it someone can improve this to make it work with a text selection from any app, and to get the resulting draft message to appear on its own window rather than in another viewer window.

[ Reply to This | # ]