--发送iMessage
备注:发送前需要对手机号进行校验
--批量文件方式
tell application
"Messages"
set
csvData to read
"/Users/liuyujie/Desktop/test.csv"
set
csvEntries to paragraphs of csvData
repeat with
i from 1 to count csvEntries
set
targetBuddy to (csvEntries's item i)'s text
set
targetService to (id of 1st service whose service type = iMessage
)
set
theBuddy to buddy targetBuddy of service id targetServicesend "修改代码,获取变量值:" & targetService to theBuddy
end repeat
end tell
--单条方式
tell application
"Messages"
set
targetBuddy
to "185xxxx827"
set
targetService to id of 1st service whose service type = iMessage
repeat 1 times
set
textMessage to "TestAppleScriptIMessageBy金。。
"
set
theBuddy to buddy targetBuddy of service id targetServicesend textMessage to theBuddy
end repeat
end tell