Skip to content

Commit

Permalink
Added mailArchive source, script and app
Browse files Browse the repository at this point in the history
  • Loading branch information
Rob Lacey committed Oct 5, 2011
1 parent 024721a commit 853b92e
Show file tree
Hide file tree
Showing 9 changed files with 71 additions and 0 deletions.
44 changes: 44 additions & 0 deletions mailArchive.app/Contents/Info.plist
@@ -0,0 +1,44 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleAllowMixedLocalizations</key>
<true/>
<key>CFBundleDevelopmentRegion</key>
<string>English</string>
<key>CFBundleExecutable</key>
<string>applet</string>
<key>CFBundleIconFile</key>
<string>applet</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>mailArchive</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleSignature</key>
<string>aplt</string>
<key>LSMinimumSystemVersionByArchitecture</key>
<dict>
<key>x86_64</key>
<string>10.6</string>
</dict>
<key>LSRequiresCarbon</key>
<true/>
<key>WindowState</key>
<dict>
<key>dividerCollapsed</key>
<false/>
<key>eventLogLevel</key>
<integer>-1</integer>
<key>name</key>
<string>ScriptWindowState</string>
<key>positionOfDivider</key>
<real>329</real>
<key>savedFrame</key>
<string>227 141 715 737 0 0 1280 878 </string>
<key>selectedTabView</key>
<string>result</string>
</dict>
</dict>
</plist>
Binary file added mailArchive.app/Contents/MacOS/applet
Binary file not shown.
1 change: 1 addition & 0 deletions mailArchive.app/Contents/PkgInfo
@@ -0,0 +1 @@
APPLaplt
Binary file not shown.
Binary file added mailArchive.app/Contents/Resources/applet.icns
Binary file not shown.
Binary file added mailArchive.app/Contents/Resources/applet.rsrc
Binary file not shown.
4 changes: 4 additions & 0 deletions mailArchive.app/Contents/Resources/description.rtfd/TXT.rtf
@@ -0,0 +1,4 @@
{\rtf1\ansi\ansicpg1252\cocoartf1038\cocoasubrtf360
{\fonttbl}
{\colortbl;\red255\green255\blue255;}
}
22 changes: 22 additions & 0 deletions mailArchive.applescript
@@ -0,0 +1,22 @@
set theAccounts to {"PledgeMusic"}
set theMailboxes to {"INBOX", "Sent Messages"}

tell application "Mail"
repeat with theAccount in theAccounts
display dialog theAccount
repeat with theMailbox in theMailboxes
set oldMessages to ((every message of mailbox theMailbox of account theAccount) whose (date sent < (current date) - 365 * days))
if (count oldMessages) is greater than 0 then
set theAccountArchive to (theAccount & "Archive")
display dialog "Archiving " & (count oldMessages) & " messages."
if not (exists mailbox theAccountArchive) then
make new mailbox with properties {name:theAccountArchive}
end if
if not (exists mailbox theMailbox of mailbox theAccountArchive) then
make new mailbox with properties {name:(theAccountArchive & "/" & theMailbox)}
end if
move oldMessages to mailbox theMailbox of mailbox theAccountArchive
end if
end repeat
end repeat
end tell
Binary file added mailArchive.scpt
Binary file not shown.

0 comments on commit 853b92e

Please sign in to comment.