环境要求:
Mac OS 10.8以上版本,Messages应用程序,AppleScript编辑器(以上都是内置)
原理:
AppleScript是苹果公司开发的一种脚本语言,可以用来控制运行于Mac OS上的程序
通过一个循环语句,即可实现重复发送。
注:接受者可以填手机号,也可以填邮箱号,但必须是开通Imessage的账号
手机号格式:XXX-XXXX-XXX
Sample:
模仿前阵子特别水的某打车平台的广告
#!/usr/bin/osascript on run argv <span style="white-space:pre"> </span>set msg to item 1 of argv tell application "System Events" tell application "Messages" to activate end tell tell application "Messages" repeat 20 times set myid to get id of first service set theBuddy to buddy "XXXX@icloud.com" of service id myid send ":-)风靡全国的打车神器 :-)免费叫出租 1分钟应答 :-)已开通北京、上海、广州、武汉、天津、南京 :-)下载:http://ums.bz/MK4SaR/ 新浪官方微博@滴滴打车" to theBuddy end repeat end tell end run