Enable access for assistive devices programmatically on 10.9

Discussion in 'OS X Mavericks (10.9)' started by vinpai, Jul 24, 2013.

  1. vinpai macrumors newbie

    Joined:
    Jul 24, 2013
    #1
    Hello All,

    With 10.9, Apple has moved Accessibility option to System Preferences > Security & Privacy > Privacy > Accessibility. Unlike previous versions of Ma OS X, which used a universal checkbox for all applications, the new functionality in 10.9 allows users to individually choose which apps can gain control of the system to perform their various scripted functions.

    Solution:
    Apple has NOT provided any API to developers to programmatically enable Accessibility for Application. So Mac OS 10.9 will Prompt a dialog for end user permission to enable Accessibility when application uses accessibility APIs. Additionally User has to Relaunch the application after enabling Accessibility.

    Default prompt dialog put up by 10.9 OS for Sample application "Accessibility Inspector".
    On click of "Open System Preferences" the Security & Privacy Preference will open with sample application "Accessibility Inspector". User needs to enable Application using admin password.

    Can we enable access for assistive devices programmatically on 10.9 using Applescript or any other APIs?

    Any help to fix this issue would be greatly appreciated.

    Thanks & Regards
    Vinayak Pai
    --
     

    Attached Files:

  2. abstert macrumors newbie

    Joined:
    Jun 10, 2008
    Location:
    Santa Clara, CA
    #2
    Command line - Assistive Devices

    Hello,

    I believe the command you are looking for is to find the Bundle Identifier for the application you are trying to add to Assistive Devices.

    Code:
    /usr/libexec/PlistBuddy -c 'Print CFBundleIdentifier' /Applications/enterapplicationnamehere.app/Contents/Info.plist
    Let's say the application you were trying to add was SKYPE. You would then enter this below:

    Code:
    /usr/libexec/PlistBuddy -c 'Print CFBundleIdentifier' /Applications/Skype.app/Contents/Info.plist
    And your bundle identifier would be :
    Code:
    com.skype.skype
    You then use this output in the following command to add the application to Assistive Devices in the Security and Privacy section:

    Code:
    sudo sqlite3 /Library/Application\ Support/com.apple.TCC/TCC.db "INSERT INTO access VALUES('kTCCServiceAccessibility','enterbundleIDhere',0,1,1,NULL);" 
    For our Skype example:

    Code:
    sudo sqlite3 /Library/Application\ Support/com.apple.TCC/TCC.db "INSERT INTO access VALUES('kTCCServiceAccessibility','com.skype.skype',0,1,1,NULL);" 
    To remove the application you would use this:
    Code:
    sudo sqlite3 /Library/Application\ Support/com.apple.TCC/TCC.db "delete from access where client='com.skype.skype';"
     

Share This Page