简体   繁体   English

从applescript中的规则将内容获取到邮件消息失败

[英]Getting the content to a mail message from a rule in applescript fails

I am trying to grab the body text of an email message (In this example I'm using the email subject to avoid any issues with text formatting) I'm sure this used to work:- 我正在尝试获取电子邮件的正文(在本示例中,我使用电子邮件主题来避免文本格式的任何问题),我确信这可以正常工作:-

using terms from application "Mail"
 on perform mail action with messages theMessages
  tell application "Mail"
   activate
   set theMessage to item 1 of theMessages
   try
    set theMessageSubject to the subject of theMessage
   on error errMsg
    display dialog "Error: " & errMsg
   end try
  end tell
 end perform mail action with messages
end using terms from

RESULT -> Error: Can't get <<class mssg>> 1 of <<class mact>> "Incoming POP Messages" of <<class mact>> "My Email Account". Invalid Index.

I have also tried using "repeat with theMessage in theMessages" same result. 我也尝试过使用“在theMessages中与theMessage重复”相同的结果。

I've also tried inserting multiple delays because I read that that would help but it didn't here. 我还尝试插入多个延迟,因为我读到这会有所帮助,但这里没有。

This seems to be a bug with how Apple Mail handles incoming POP messages. Apple Mail如何处理传入的POP消息似乎是一个错误。 I am now using an IMAP account instead and that is an acceptable solution for me. 我现在改为使用IMAP帐户,这对我来说是可以接受的解决方案。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM