0

I'm trying to use AppleScript to control System Preferences in the background. Specifically, I am trying to Enable / Disable "Badge app icons" for each app. There is no global way to enable / disable badge app icons in system preferences. This must be done per app.

Any idea how this might be done?

Daniel
  • 11

1 Answers1

0

Your question is broad, but here are some pointers:

  • While System Preferences.app can be controlled from an AppleScript, support is limited to revealing (opening) the application to a specific pane and anchor (tab).

  • Your best bet is to modify the underlying SQLite 3 database in which the per-application notification preferences are maintained - this answer will hopefully get you started.

    • macOS comes with the sqlite3 CLI.
    • From what I understand, while AppleScript has - limited - support for accessing SQLite databases via the Database Events app, using do shell script to call the sqlite3 utility may be the better option.
      (In fact, in a brief test I wasn't even able to open a database in AppleScript on my macOS 10.12.4 machine)
Community
  • 1
  • 1
mklement0
  • 382,024
  • 64
  • 607
  • 775