简体   繁体   中英

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. Is this possible? This is the AppleScript I wrote:

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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