Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

JordanJ

macrumors member
Original poster
Mar 10, 2012
38
0
Australia
I am a newbie to AppleScript (I really should say dummie!) but have worked with a few programming languages before.

My situation is this:

"I have become REALLY lazy with my mail. I usually get a lot of email from the same people / companies. I would like to set up a mac mail rule so that:

Once email is received from "sender@example.com", and is read, move to "Folder 3"

I have tried to set this up in Mac Mail Rules, (Preferences > Rules) but I cannot see an option for "Mail is Read" in the conditions box."

I am aware there is an AppleScript "property" for Mail (read status) but I am not sure how to implement this and the syntax for the script.

Is there a basic syntax that I should follow when using Apple Script?

NB: I am currently running OS X 10.7.5, however I will move to 10.8 in the near future. (Before the end of the year).

Thanks!
 
Try this :

  1. Create new mailbox named Folder 3 in Mail. See Attached Images.
  2. Create new rule in Mail. See Attached Thumbnails. In Perform the following actions : choose Run Applescript and select the script you saved in step 3.
  3. Paste code in Script Editor and save script.

    Code:
    using terms from application "Mail"
    	on perform mail action with messages theMessages for rule theRule
    		tell application "Mail"
    			repeat with eachMessage in theMessages
    				if eachMessage's read status is true then
    					move eachMessage to mailbox "Folder 3"
    				end if
    			end repeat
    		end tell
    	end perform mail action with messages
    end using terms from
 

Attachments

  • Picture 1.png
    Picture 1.png
    53.5 KB · Views: 114
  • Picture 2.png
    Picture 2.png
    11.8 KB · Views: 907
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.