在没有好友ID的情况下使用OsaScript发送Imessage

时间:2020-09-27 04:03:36

标签: imessage osascript

有人可以告诉我如何将消息发送给以前未使用消息发送过消息的人。当我使用下面的代码时,收到错误消息:execution error: Messages got an error: Can’t get buddy id "..."(如果以前没有给他们发送消息。.

on run {targetBuddyPhone, targetMessage}
    tell application "Messages"
        set targetService to service "SMS"
        set targetBuddy to buddy targetBuddyPhone of targetService
        send targetMessage to targetBuddy
    end tell
end run

提前谢谢

0 个答案:

没有答案
相关问题