MAC使用imessage自动发消息
2015-04-16 15:24
316 查看
用excel建一个csv文件,第一个字段为号码,第二个字段为内容
//csv文件内容
189*****773;hello1
189*****773;hello2
189*****773;hello3
189*****773;hello4
打开脚本编辑器
tell application "Messages"
set the this_folder
to path to
desktop folder as
alias
set thefullpath
to POSIX path
of this_folder
set csvData
to read
thefullpath & "/test.csv"
set csvEntries
to paragraphs
of csvData
set targetService
to id of 1st
service whose
service type = iMessage
repeat with i
from 1 to count
csvEntries
set
potion to (offset
of ";" in (csvEntries's
item i)'s
text)
set
phone to text 1
thru (potion - 1)
of (csvEntries's
item i)'s
text
set
messageBody to text (potion + 1)
thru -1 of (csvEntries's
item i)'s
text
set
theBuddy to buddy
phone of
service id
targetService
send
messageBody to
theBuddy
end repeat
end tell
代码很简单没什么可讲的,测试通过
//csv文件内容
189*****773;hello1
189*****773;hello2
189*****773;hello3
189*****773;hello4
打开脚本编辑器
tell application "Messages"
set the this_folder
to path to
desktop folder as
alias
set thefullpath
to POSIX path
of this_folder
set csvData
to read
thefullpath & "/test.csv"
set csvEntries
to paragraphs
of csvData
set targetService
to id of 1st
service whose
service type = iMessage
repeat with i
from 1 to count
csvEntries
set
potion to (offset
of ";" in (csvEntries's
item i)'s
text)
set
phone to text 1
thru (potion - 1)
of (csvEntries's
item i)'s
text
set
messageBody to text (potion + 1)
thru -1 of (csvEntries's
item i)'s
text
set
theBuddy to buddy
phone of
service id
targetService
send
messageBody to
theBuddy
end repeat
end tell
代码很简单没什么可讲的,测试通过
相关文章推荐
- Mac下使用Charles抓Android下的https消息
- EasyNetQ使用(八)【对延迟消息插件的支持,自动订阅者】
- 使用 Virtual Box (mac 版)安装 xp 虚拟机剪切板不能共享,屏幕不能自动调整的解决办法
- Mac 下使用命令行自动补全--bash-completion--git命令自动补全
- [Android] mac上申请签名及使用ant自动编译打包签名APK
- mac使用expect实现自动登录跳板机
- 微信--使用客服消息异步自动回复用户消息
- Mac使用技巧——Mac关闭iTunes自动备份功能
- 使用Powerpoint for macos自动合并pptx文件
- 这是在MAC雪豹系统,使用电信高校校园网发布的一条消息
- mac下使用bash-completion进行git命令自动补全
- mac 中使用 AppleScript 来发送 iMessage
- Mavlink消息的自动生成与使用
- Mac中jenkins的使用——自动构建
- 在Mac上使用git的时候,如何让命令自动完成
- 使用 generator 自动生成代码,为什么在 mac 下不能生成到 src 目录下
- 解决Mac下使用iTerm连接远程机器超时自动断开的问题
- 【C++中消息自动派发之四】使用IDL构建Chat Server
- 使用Python制作自动推送微信消息提醒的备忘录功能
- C语言宏定义##连接符和#符的使用(MFC就是靠##自动把消息和消息函数对应起来了,借助宏来减少switch case代码的编写量)