tell application "Messages" to activate
tell application "System Events"
tell process "Messages"
tell window 1
repeat 50 times --这里输入需要删除的数量
delay 0.5 -- 延时0.5秒
click UI element 1 of group 1 of group 1 of group 1 of group 2 of group 1 of group 1 of group 1 of group 2 of group 1 of group 1 of group 1 of group 1 of group 1 of group 1 of group 1 --选中第一个会话
delay 0.5 -- 延时0.5秒
click menu item "删除对话…" of menu "文件" of menu bar item "文件" of menu bar 1 of application process "Messages" of application "System Events" --激活右键菜单中的删除对话
click button "删除" of sheet 1 of window 1 of application process "Messages" of application "System Events" --在确认删除弹窗中点击删除
end repeat
end tell
end tell
end tell
macOS自动删除短信的脚本
于 2022-03-14 22:42:19 首次发布