Automator / AppleScript to process incoming emails in Mac Mail

后端 未结 3 1708
攒了一身酷
攒了一身酷 2021-01-14 06:47

I\'m designing an app that allows users to email me crash reports if my app ever crashes. I\'d like to leave Mac Mail running on a computer and when an email comes through,

3条回答
  •  再見小時候
    2021-01-14 07:01

    Use the Dictionary in Applescript Editor to see the properties of mail and you'll quickly be able to see the properties of any mail message. Here's a quick and dirty example of getting the content of a mail message.

    tell application "Mail"
        set the_messages to selection
        repeat with this_message in the_messages
            set mytext to content of this_message
        end repeat
    end tell
    

    Modify the script linked to above that copies output to a temporary file and then pass that file to your Python script to act on.

提交回复
热议问题