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

applescript

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

Applescript - sync account

bryanlharris's picture

Wed, 02/05/2014 - 21:35 by bryanlharris

Save to ~/Library/Scripts

if application "Mail" is running then
	tell application "Mail"
		synchronize with account "Exchange"
	end tell
end if
* * * * * /usr/bin/osascript '/Users/bharris/Library/Scripts/Sync "Exchange" Mail account.scpt'
Tags: 
applescript
  • Read more about Applescript - sync account
Powered by Backdrop CMS