2011-01-09 34 views
0

我有一個郵件過濾器,它將運行一個Autoscript,它將複製郵件內容,然後運行Automator應用程序。但它不起作用。它不啓動Automator應用程序或複製內容。AppleScript問題(複製電子郵件內容,運行Automator應用程序)

所以我有一個電子郵件進來,它告訴這個Applescript運行。如果我進入並編輯Applescript(甚至24小時後沒有關閉,只能睡眠),並刪除除最後一行之外的所有內容,並單擊保存AppleScript啓動應用程序。我有一種感覺,第一塊代碼有問題。當電子郵件進來時,我將Mail設置爲發出聲音,運行腳本並刪除電子郵件,因此我知道腳本被告知要運行。

  • 如何刪除電子郵件文件?
  • 爲什麼在AppleScript 編輯器中打開 AppleScript之後,它僅會運行 ?這真是愚蠢。

這是當前的AppleScript如下:

using terms from application "Mail" 
    on perform mail action with messages matchmsgs for rule mailrule 
     tell application "Mail" 
      set msg to item 1 of matchmsgs 
      set msgcontent to (content of msg) as Unicode text 
     end tell 
     set the clipboard to msgcontent 
     tell application "/Users/me/Docs/Update App.app" to activate 
    end perform mail action with messages 
end using terms from 
+0

如何以及在哪裏無效? – 2011-01-10 10:17:07

+0

我將它保存在一個applescript中,當有一封電子郵件進入該過濾器時,讓mail.app程序運行它。編輯的問題,以包括一些細節... – michaellindahl 2011-01-10 23:05:24

回答

0

我相信郵件規則,所有的你的AppleScript代碼必須與信息matchmsgs進行郵件操作的規則mailrule塊的內碼。因此,請嘗試移動線路告訴應用程序「更新應用程序」以激活,直到線路將剪貼板設置爲msgcontent

相關問題