|
Revision 59, 0.6 kB
(checked in by otsune, 6 years ago)
|
|
Added Read to Trash in Mail.app
|
| Line | |
|---|
| 1 | (* |
|---|
| 2 | Read to Trash |
|---|
| 3 | |
|---|
| 4 | This is a script moving an marked read messages to a trash box in Mail.app. |
|---|
| 5 | This is usable as a rule action. |
|---|
| 6 | |
|---|
| 7 | author: Masafumi Otsune http://www.otsune.com/ |
|---|
| 8 | *) |
|---|
| 9 | |
|---|
| 10 | using terms from application "Mail" |
|---|
| 11 | on perform mail action with messages theMessages for rule theRule |
|---|
| 12 | tell application "Mail" |
|---|
| 13 | set max_value to number of items in theMessages |
|---|
| 14 | repeat with i from 1 to max_value |
|---|
| 15 | set this_item to item i of theMessages |
|---|
| 16 | if (read status of this_item) then |
|---|
| 17 | delete this_item |
|---|
| 18 | end if |
|---|
| 19 | end repeat |
|---|
| 20 | end tell |
|---|
| 21 | end perform mail action with messages |
|---|
| 22 | end using terms from |
|---|