A dome scratcher: mail.app rules & AS
A dome scratcher: mail.app rules & AS
- Subject: A dome scratcher: mail.app rules & AS
- From: Luc Dore VA2KSH <email@hidden>
- Date: Fri, 23 Apr 2004 12:30:24 -0400
Hi Folks,
I just got a good one. I'm writing a script to be run as a rule within
mail.app; where every message would be filtered through it and
if the script matches a certain number of keywords it moves it to the
trash. I noticed after running it for a little while that messages are
not deleted from the server and new mail would repeat over and over and
over.
Here is the simplified script:
on run
tell application "Mail"
set theSelection to selection
end tell
end run
on perform_mail_action(info)
tell application "Mail"
set selectedMessages to |SelectedMessages| of info
my processTheEMail(selectedMessages)
end tell
end perform_mail_action
on processTheEMail(TheEMails)
try
tell application "Mail"
repeat with eachMessage in TheEMails
set read status of eachMessage to true
set mailbox of eachMessage to mailbox "Trash"
-- delete eachMessage
end repeat
end tell
on error theErr number theNum
display dialog "Err#:" & theNum & " " & theErr
end try
end processTheEMail
So putting in remarks the two lines "set mailbox..." and "delete ..."
makes the messages stop repeating and I noticed they are deleted from
the server. Un-remarking one of the two lines makes the script run but
messages are never deleted from my pop server.
My rule is set to run on every message where it executes this script.
Can anyone help me ?
thanks !
Luc D.
_______________________________________________
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.