Re: Can a link be extracted? (Automating Emailer)
Re: Can a link be extracted? (Automating Emailer)
- Subject: Re: Can a link be extracted? (Automating Emailer)
- From: Nigel Garvey <email@hidden>
- Date: Thu, 4 Apr 2002 11:51:09 +0100
David Groover wrote on Wed, 3 Apr 2002 10:26:33 -0500:
>
I am trying to get Emailer to either command click on an HTML line in an
>
incoming message or to pull the HTML line out of it and set it to the url
>
of an active IE window. Is this something that I can use AS to do?
>
>
Using Emailers mail actions I can start the script.
>
>
The point is to monitor a specific forum, where I am waiting for answers
>
to posts. The forum will automatically send me an email notifying me that
>
some one has responded to my thread. Since all the message is the same,
>
same headier, subject and body, except for the link, I shouldn't need to
>
do a complicated grep pattern match to find it, should I?
>
>
Each alert message has two paragraphs, The first is who replied and the
>
name of the topic. The second is just one line as follows:
>
>
This topic is located at
>
HTTP://www.macgurus.com/ubb/Forum4/HTML/000566.HTML
>
>
Of course, the URL will be different depending on the thread.
>
>
The point of all this is to have a notification automatically take me to
>
the page under discussion.
>
Much thanks
To get the URL from the text of a filtered message using a Mail Action
script, you could do something like this:
tell application "Claris Emailer"
set theText to the content of filtered message
repeat with thisPara in the paragraphs of theText
if thisPara begins with "This topic" then
set theURL to (text from word 6 to end) of thisPara
exit repeat
end if
end repeat
end tell
You'd then tell IE to do something with theURL. I don't have IE
installed, but with Navigator, the basic command would be be:
tell application "Netscape Navigator"
OpenURL theURL
end tell
I'm away from home at the moment and am not able to test the full
process. (Using the hotel phone for this is too expensive. ;-)) The above
may be OK as it stands, but I can foresee possible problems when trying
to open a connection with another app as part of a Mail Action,
especially if the message is not the only one being downloaded. I'd be
more inclined to try it as a "New mail notification" script (see under
Preferences, if you're using Emailer 2.0), which will only run after all
the mail has been downloaded. The rough idea for this would be:
tell application "Claris Emailer"
set theAlerts to every incoming message of the in box folder whose
read status is untouched and subject is "Whatever the subject usually is"
repeat with thisMessage in theAlerts
set theText to the content of thisMessage
repeat with thisPara in the paragraphs of theText
if thisPara begins with "This topic" then
set theURL to (text from word 6 to end) of thisPara
exit repeat
end if
end repeat
my goToTopic(theURL)
set thisMessage's read status to read
end repeat
end tell
on goToTopic(theURL)
tell application "Internet Explorer"
-- activate
-- make a new window
-- open theURL in it
end tell
end goToTopic
You'll no doubt have to fiddle with this, but I hope it gets you started.
NG
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.