System events script sometimes works, sometimes doesn't
1
vote
1
answer
204
views
This is a part of a bigger script that I isolated and have an issue with:
tell application "Google Chrome" to activate
delay 2
tell application "System Events"
click ¬
pop up button "Multi Layout Manager" of ¬
toolbar 1 of group 1 of window 1 of ¬
application process "Chrome"
delay 0.2
repeat 3 times
key code 48 -- # tab key
delay 0.2
end repeat
key code 36 -- # enter key
end tell
It automatically clicks on a Chrome extension (Multi Layout Manager) and selects a saved template.
Sometimes it works like a charm, then other times it just doesn't.
The error I get is this:
error "System Events got an error: Can’t get pop up button \"Multi Layout Manager\" of toolbar 1 of group 1 of window 1 of application process \"Chrome\"." number -1728 from pop up button "Multi Layout Manager" of toolbar 1 of group 1 of window 1 of application process "Chrome"
I can't figure out what's wrong here. Some help would be great.
thank you
Asked by KhalDrogoSings
(61 rep)
Jun 23, 2022, 02:17 PM
Last activity: Jul 9, 2025, 07:07 AM
Last activity: Jul 9, 2025, 07:07 AM