【问题标题】:Sending messages with AppleScript使用 AppleScript 发送消息
【发布时间】:2015-09-02 01:22:32
【问题描述】:

我可以向已经使用 buddy 的指定人员发送消息。我在 iMessage 中注册了多封电子邮件,所以我想知道如何在实际脚本中选择从哪个帐户发送消息?

我没有尝试过任何东西,因为我对 AppleScript 不是很熟悉

例如:

  • 将 acc1 设置为 coolemail1@emails.com
  • 将 acc2 设置为 coolemail2@emails.com

我想从coolemail1 发送“嗨”,从coolemail2 发送“你好吗”

我该怎么做?

-我真的很不擅长提出问题对不起

【问题讨论】:

    标签: automation applescript messages


    【解决方案1】:

    发件人帐户是邮件的发件人属性。

    此发件人通常采用 contact_name 形式。

    要仅提取电子邮件地址并与您的 acc1/acc2 进行比较,您必须使用“extract address from”指令。

    见下面的例子:

    set Acc1 to "coolemail1@emails.com"
    set acc2 to "coolemail2@emails.com"
    tell application "Mail"
    set theMails to every message of inbox whose subject contains "your selection"
    repeat with I from 1 to count of theMails
    set My_Sender to extract address from sender of item I of theMails
    if My_Sender is Acc1 then
       -- do something
       else
       -- do something else for the second name
       end if
    end repeat
    end tell
    

    【讨论】:

      猜你喜欢
      • 2012-03-08
      • 2023-01-22
      • 2015-03-26
      • 2018-06-26
      • 2018-01-04
      • 2020-08-04
      • 2018-05-25
      • 2014-12-28
      相关资源
      最近更新 更多