2012-01-13 29 views
1

我是Applescript的新手,我遇到了一個問題。我的郵件「收件箱」中有多個文件夾。但是,我想只選擇其中一個收件箱來在其上運行腳本。AppleScript在Apple Mail中選擇特定的收件箱

這是我的。但是,我似乎無法找到Gmail帳戶的收件箱。

任何想法?

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 

回答

2

看來,雖然我還沒有看到這個記錄隨時隨地,即收件箱總是命名爲「INBOX」(區分事項)郵箱。因此,下面是我做的when I need to access an account-specific inbox

set _inbox to mailbox "INBOX" of account "Gmail" 

這是你訪問任何郵箱以同樣的方式,你只需要使用這個特殊的名字。還請注意,您可能還需要在move聲明中使用mailbox "Unread" of account "Gmail"表單,但我不確定;你需要測試這個。

+0

這解決了我的問題,這與OP的問題是一樣的。謝謝。 OP應該將其標記爲答案。 – h4ckNinja 2016-07-02 20:39:29

相關問題