apple mail - Applescript Moving Email to Trash, But Not Deleting from the Server -


i wrote applescript moves selected emails trash. script works fine in regard. problem emails remain on server. there additional code need add that? here's code:

using terms application "mail" on perform mail action messages these_messages rule this_rule     tell application "mail"         set message_count count of these_messages         repeat message_count 1 -1             set this_message item of these_messages             set this_content (every character of content of this_message) unicode text             if "bowles" not in this_content , "patton" not in this_content                 set theaccount account of mailbox of this_message                 set mailbox of this_message mailbox "trash" of theaccount             end if         end repeat     end tell end perform mail action messages end using terms 

it hard troubleshoot without seeing entire script , other rules may causing problem. try adding stop evaluating rules action rule :

enter image description here

using terms application "mail" on perform mail action messages these_messages rule this_rule     tell application "mail"         repeat this_message in these_messages             set this_content content of this_message             if "bowles" not in this_content , "patton" not in this_content                 set theaccount account of mailbox of this_message                 set junk mail status of this_message false                 set mailbox of this_message mailbox "trash" of theaccount             end if         end repeat     end tell end perform mail action messages end using terms 

Comments

Popular posts from this blog

delphi - How to convert bitmaps to video? -

jasper reports - Fixed header in Excel using JasperReports -

python - ('The SQL contains 0 parameter markers, but 50 parameters were supplied', 'HY000') or TypeError: 'tuple' object is not callable -