2018-03-07

2018-03-07  本文已影响57人  Youthfulless

iMessage 群发短信

1:先学习AppleScript

2:tell application"Messages"

set csvData to read"/Users/xxxx/Desktop/test.csv"

set csvEntries to paragraphs of csvData

repeatwithi from 1 to count csvEntries

set phone to (csvEntries's item i)'s text

        set myid to get id of first service

        set theBuddy to buddy phone of service id myid

send"今天北京晴,气温13到27度;周二晴,气温11到26度,北风3-4级;周三晴,气温11到24度,微风<3级"to theBuddy

    end repeat

end tell

3:解决mac电脑下 csv文件乱码问题 请自动移动http://blog.sina.com.cn/s/blog_69e225900102w2mc.html

4:tell application "Messages"

set csvData to read "/Users/apple/Desktop/2017.csv"

set csvEntries to paragraphs of csvData

repeat with i from 1 to count csvEntries

try

set phone to (csvEntries's item i)'s text

set phone to (csvEntries's item i)'s text

set myid to get id of first service

set theBuddy to buddy phone of service id myid

send "亲爱的用户你好,您的初审已通过,请您尽快添加客服QQ:2675016092进行审核。" to theBuddy

end try

end repeat

end tell.  <这段代码不会因错误而终止message发送>

上一篇下一篇

猜你喜欢

热点阅读