Skip to main content
Home
badllama.com
  • Search
  • Log In

exchange

Move messages older than one day

bryanlharris's picture

Mon, 02/24/2014 - 15:26 by bryanlharris

property secondsInOneDay : 86400

tell application "Mail"
	set theInbox to mailbox "Inbox" of account "Exchange"
	set dateToday to current date
	set firstMessage to 1
	set lastMessage to (get count of messages in theInbox)
	
	repeat with thisMessage from lastMessage to firstMessage by -1
		set currentMessage to message thisMessage of theInbox
		set messageDate to date received of currentMessage
		set timeDifference to dateToday - messageDate
		
		if timeDifference ≥ secondsInOneDay then
			set archiveMailbox to (mailbox ("Exchange inbox archive" as string))
Tags: 
applescript
exchange
osx
  • Read more about Move messages older than one day
Powered by Backdrop CMS