I want to be able to change the default web browser of my Mac to Google Chrome using AppleScript. Here is my idea:
set result to button returned of (display dialog "Would you like to change to Chrome?")
if result = "OK" then
do shell script ("open -a 'Google Chrome' --args --make-default-browser")
else
display dialog "No change in the default web browser"
end if
However, I always get this window popping up that I cannot programmatically deal with for some reason. I want to select "Use Chrome".
I know of a few manual ways of changing it, such as in the 'General' tab of the System Preferences but I need something reliable such as this shell command.
How do I accomplish the above via AppleScript?