Issue
What is the simple way to get the 'delete' button 'clicked' in response to the popup pictured below from the Messages app? I've tried more variations than I care to admit and am feeling humbled.
This code works fine if I want to 'click' the 'cancel' button in the popup.
But nothing I have tried has worked to click the 'delete' button.
Messages popup after delete message pulldown
tell application "Messages"
activate
end tell
tell application "System Events"
key code 2 using command down
end tell
tell application "System Events"
set frontmost to true
delay 1
click button "Cancel"
end tell
Solution
This should work for you.
tell application "System Events" to tell application process "Messages"
set frontmost to true
repeat until frontmost
delay 0.1
end repeat
click UI element "Delete" of sheet 1 of window 1
end tell
Answered By - wch1zpink Answer Checked By - David Marino (PHPFixing Volunteer)
0 Comments:
Post a Comment
Note: Only a member of this blog may post a comment.