I am new to Applescript and I am running into an issue. I have multiple folder in my Mail "Inbox". However, I would like to just select one of these inboxes to run the script on it.
Here is what I have. However, I cannot seem to find the Inbox for the Gmail account.
Any ideas?
set _ago to (current date) - days
set _inbox to "Inbox:Gmail"
tell application "Mail"
move (messages of _inbox whose read status is false and date received comes before _ago) to mailbox "Gmail - Unread"
move (messages of _inbox whose date received comes before _ago) to mailbox "Gmail - Archive"
end tell
It seems, although I haven't seen this documented anywhere, that inboxes are always mailboxes named "INBOX" (case matters). Thus, the following is what I do when I need to access an account-specific inbox:
It's the same way you'd access any mailbox, you just use this particular name. Note also that you might need to use the
mailbox "Unread" of account "Gmail"
form in yourmove
statements as well, but I'm not sure; you'd need to test this.