I've been doing some research on this topic but it seems Apple has changed their file hierarchy. From the MacScripter post "Get user default browser" it references the line:
set pListpath to (path to preferences as Unicode text) & "com.apple.LaunchServices.plist"
but when running the handler in Sierra I'm returned an error that the file is empty. Further research I found "How to use an AppleScript app bundle as the default browser in os x?" and "Use default browser in custom Apple Script?" that suggest:
on open location theURL
...
end open location
but I'm wanting to preserve the browser in a variable to reference later on in my script. In Sierra is there a file or way to reference what the default browser?
Best Answer
Correct, the file for has changed to
~/Library/Preferences/com.apple.LaunchServices/com.apple.launchservices.secure.plist
.I'm running macOS 10.13 (High Sierra), but the script should work with Sierra as well. Please report back.
The output will look like this: