Skip to main content
deleted 4 characters in body
Source Link
Nimesh Neema
  • 52.9k
  • 25
  • 151
  • 212

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.screenshot that comes up when you call default browser

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

screenshot that comes up when you call default browser

tell application "System Events"
        tell process "SecurityAgent"
            click button 1 of window 1
        end tell
        delay 0.2
end tell

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 can install it using brew defaultbrowser or build from source.

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 script. Below is a screenshot.

###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

screenshot that comes up when you call default browser

I am trying to change the default browser between Chrome and Safari without needing user input except for initially running it.

I found this utility that takes care of the difficult bit:

It can be installed using 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 AppleScript. Below is a screenshot.

screenshot that comes up when you call default browser

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
Source Link
user14492
  • 1.1k
  • 10
  • 20

How to find the application that controls system dialog window

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 can install it using brew defaultbrowser or build from source.

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 script. Below is a screenshot.

###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

screenshot that comes up when you call default browser