用applescript发短信

时间:2015-02-01 04:02:15

标签: macos sms applescript osx-yosemite

我想在OS X Yosemite上使用AppleScript和iCal自动向我的特殊叔叔发送短信。这可能吗?这是我写的AppleScript:

using terms from application "Messages"
on service_type with SMS
    send this_Message to this_buddy with this_Chat
    set this_name to the name of this_buddy
    if the name of this_buddy is in {Uncle, Jose} then
        set canned_responses to {Happy, Birthday, Uncle, Hose}
        set this_messsage to canned_responses
    end if
end service_type

结束使用

中的条款

这会有用吗?这不是他的生日,所以我真的无法运行剧本,我的意思是我可以,但它没有给出任何反馈。任何帮助将不胜感激。

1 个答案:

答案 0 :(得分:1)

tell application "Messages"
    -- Create variable containing the name of how your uncle is listed in your contacts
    set theBuddy to buddy "Contact name"

    -- Send the text. Change "Text message" to your own message
    send "Text message" to theBuddy
end tell