Skip to content

Instantly share code, notes, and snippets.

@reitermarkus
Last active February 6, 2022 14:00
Show Gist options
  • Save reitermarkus/54982e6367508dde7763 to your computer and use it in GitHub Desktop.
Save reitermarkus/54982e6367508dde7763 to your computer and use it in GitHub Desktop.
Scripts to enable Assistive Access programmatically on OS X El Capitan.
#!/usr/bin/python
# Grant Assistive Access to Terminal and “osascript”.
import sqlite3
conn = sqlite3.connect('/Library/Application Support/com.apple.TCC/TCC.db')
conn.cursor().execute("INSERT or REPLACE INTO access VALUES('kTCCServiceAccessibility','com.apple.Terminal',0,1,1,NULL,NULL)")
conn.cursor().execute("INSERT or REPLACE INTO access VALUES('kTCCServiceAccessibility','$(which osascript)',1,1,1,NULL,NULL)")
conn.commit()
conn.close()
#!/bin/sh
# Grant Assistive Access to Terminal and “osascript”.
sudo sqlite3 <<EOF
.open '/Library/Application Support/com.apple.TCC/TCC.db'
insert or replace into access values('kTCCServiceAccessibility','com.apple.Terminal',0,1,1,NULL,NULL);
insert or replace into access values('kTCCServiceAccessibility','$(which osascript)',1,1,1,NULL,NULL);
.quit
EOF
@rutgerrrrr
Copy link

Would disabling SIP work?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment