我有这个发送多条短信的脚本,但有时脚本会将第一条消息发送到我最近在消息中发送消息的另一个号码。我似乎无法找到一种模式,有时会发生错误,有时它会将所有文本发送到正确的数字。
--usage: osascript sendMessage phone_number text_to_send amount_to_send
--Sends targetMessage to targetBuddyPhone repeatAmount times to targetMessage
on run {targetBuddyPhone, targetMessage, repeatAmount}
set counter to 0
repeat while counter < repeatAmount
tell application "Messages"
send targetMessage to buddy targetBuddyPhone of service "SMS"
set counter to counter + 1
end tell
end repeat
end run
我该如何解决这个问题?