LaunchAgent Applescript

ChrisTech
Contributor

Can't find what I'm looking for through searching.. so I am going to post up here.

I am trying to get the defaultbrowser program working, and it is but I get that silly prompt each time asking me if I want to keep Firefox or use Chrome. I made an Applescript that presses the "Use Chrome" button in the dialog box but then Accessibility shows up when I run it the first time and I have to confirm it in System Prefs. Is there any way around this? Currently I am running the Applescript as a LaunchAgent.

1 REPLY 1

ChrisTech
Contributor

Figured it out.

  1. Need tccutil.py installed to insert the compiled Applescript into Security & Privacy -> Accessibility
  2. Need to install defaultbrowser
  3. Create LaunchAgent that calls the Applescript
  4. Profit

tccutil.py was the missing link. I see the window at login asking me if I want to change the browser to chrome for a split second.. and then the rest of the Applescript takes care of that. Now to create a package/policy.