my first post here and I need some help. just to point out I am a total noob in this.
this is the problem I am having:
what I am trying to do is create a script that will take every message in my Junk E-mail folder and forward it to a spam blocking e-mail address.
easy enough. well it was until I switched ISP’s and now I can only forward the spam messages that dont contain URL link.
in another words I have to manually open the message , remove any traces of “http://” and then forward it on.
My question is is there a way that I can search the message body and replace just “http” with “****” and forward it on without even opening it.
This is what I had until I switched ISP and it worked great for me*
tell application "Microsoft Entourage"
forward every message in folder "Junk E-Mail" to "E-mail Address for my spam" without opening window
send every message in folder "Drafts"
delete (every message in folder "Junk E-Mail")
end tell
Thanks in advance
Zeljko
Model: PowerBook G4
Browser: Safari 525.13
Operating System: Mac OS X (10.5)
I have part of the fix- I know how to search, but not to replace. Here is what I came up with. I can’t test it because I’m not using Entourage.
tell application "Microsoft Entourage"
set junkMail to every message in folder "Junk E-Mail"
repeat with thisItem in junkMail
if message content contains "http://" then
--set "http://" to "****"
end if
end repeat
forward junkMail to "E-mail Address for my spam" without opening window
send every message in folder "Drafts"
delete (every message in folder "Junk E-Mail")
end tell
I still consider myself a noob, too, although being able to help people after only two weeks of even knowing about applescript makes me feel all warm and fuzzy inside. (Although I am home with a stomachache… think what you will, because I sure don’t know what to tell you to).
NOTICE TO UN-NOOBY PEOPLE: THIS QUESTION IS NOT ANSWERED!! (fully)
tell application "Microsoft Entourage"
set SelectedMessages to messages of folder "Junk E-mail"
repeat with n from (count SelectedMessages) to 1 by -1
set theMessage to item n of SelectedMessages
set theContent to content of theMessage as string
set AppleScript's text item delimiters to the "http"
set the textContent to every text item of the theContent
set AppleScript's text item delimiters to the "****"
set the newContent to the textContent as string
set AppleScript's text item delimiters to ""
set newMessage to make new outgoing message with properties {to recipients:"E-mail Address for my spam", content:newContent}
end repeat
send every message in folder "Drafts"
delete (every message in folder "Junk E-Mail")
end tell
it seems to be working and doing what I wanted it to do.
Cheers
Model: PowerBook G4
Browser: Safari 525.13
Operating System: Mac OS X (10.5)