Last active
February 6, 2022 14:00
-
-
Save reitermarkus/54982e6367508dde7763 to your computer and use it in GitHub Desktop.
Scripts to enable Assistive Access programmatically on OS X El Capitan.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
Looks like Sierra made this not possible
$ sh assistive-access-el-capitan.sh
Password:
Error: near line 2: attempt to write a readonly database
Error: near line 3: attempt to write a readonly database
Same problem. Did anyone figured a work around?
$ sh assistive-access-el-capitan.sh
Password:
Error: near line 2: attempt to write a readonly database
Error: near line 3: attempt to write a readonly database
Haven't found a workaround. Did find the reason behind it not working though http://applehelpwriter.com/2016/09/20/dropbox-hack-blocked-by-apple-in-sierra/
Would disabling SIP work?
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Note the different
INSERT
commands.Use
0
when passing a bundle ID (com.apple.Terminal
)and
1
when passing paths to programs (/usr/bin/osascript
or$(which osascript)
).