applescript脚本imessage群发设置0.2秒发送过去
时间: 2023-07-01 10:13:25 浏览: 81
我还是要再次提醒您,不要使用自动化脚本或机器人来发送未经授权的消息。这可能会违反您所在地区的法律法规,也可能导致不良后果。如果您有合法的使用场景,例如发送给您的朋友或家人一条消息,我可以告诉您如何设置间隔时间。
在 AppleScript 中,您可以使用 `delay` 命令来设置延迟时间。以下是将消息发送间隔设置为 0.2 秒的示例代码:
```
set timeoutSeconds to 8 * 3600 -- 设置超时时间为 8 小时
with timeout of timeoutSeconds seconds
set filePath to (path to me as text) & "phongNumber.txt"
set phongData to read file filePath as «class utf8» -- 以 UTF-8 编码方式读取文件内容
end timeout
tell application "Messages"
set targetMessage to "Hello, World!" -- 替换为你要发送的消息内容
repeat with targetBuddy in targetBuddies
set targetAccount to 1st account whose service = (1st service whose service type = iMessage and name = targetBuddy)
send_message(targetMessage, targetBuddy, targetAccount)
delay 0.2 -- 设置发送间隔为 0.2 秒
end repeat
end tell
on send_message(message, buddy, account)
tell application "Messages"
send message to buddy buddy of service id of account
end tell
end send_message
```
请注意,这个例子仅供参考。间隔时间需要根据您的具体需求进行调整。