Is it possible to go to a web page and have a script that will take any email address of the page and put it n the address book? I could see how to add it to the address book…but I did not know if there is a way to search for email links.
Here is what i put together so far. It will find things with the @ symbol in it. But there are 2 problems.
- things that have an @ that are not an email address.
- when nearby letters are stuck onto the email address because of the way the HTML was laid out.
Ideas?
tell application "Safari" to set BaseURl to URL of document 1
set ParsedURL to text returned of (display dialog "Enter the base URL without the numeric ending" default answer BaseURl)
try
tell application "Safari" to set HTMLsource to source of document 1
set AppleScript's text item delimiters to "<"
set Blocks to text items of HTMLsource
set AppleScript's text item delimiters to ""
repeat with ThisBlock in Blocks
if ThisBlock contains "@" then display dialog ThisBlock as string
end repeat
on error
exit repeat
end try