I am trying to change the default browser between Chrome and Safari without needing user input except for initially running it.
I found this defaultbrowser
utility that takes care of the difficult bit. You:
It can install itbe installed using brew defaultbrowser
or build from source.Homebrew by running:
brew defaultbrowser
However when you run it a dialogue box shows up asking if I want to change browser. I want to press the "Yes "button using apple scriptAppleScript. Below is a screenshot.
###I want to find the application that contains this window.
I want to find the application that contains this window. Is there a better way to find out where the window is rather than go through them all?
I've tried foremost window but it seems to return the foremost program. Here's some program I've tried.:
tell application "System Events"
tell process "SecurityAgent"
click button 1 of window 1
end tell
delay 0.2
end tell
tell application "System Events"
tell process "SecurityAgent"
click button 1 of window 1
end tell
delay 0.2
end tell