简体   繁体   English

用applescript发送短信

[英]send text message with applescript

I would like to automate sending a text message to a special uncle of mine using AppleScript and iCal on OS X Yosemite. 我想在OS X Yosemite上使用AppleScript和iCal自动向我的一个叔叔发送短信。 Is this possible? 这可能吗? This is the AppleScript I wrote: 这是我写的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

end using terms from 最终使用来自

Will this work? 这样行吗? It isn't his birthday yet so I really can't run the script, I mean I can but it doesn't give any feedback. 还不是他的生日,所以我真的不能运行该脚本,我的意思是可以,但是它没有给出任何反馈。 Any help would be appreciated. 任何帮助,将不胜感激。

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

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

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