Assistive Access madness

I have this down to a one line test:
tell application “Finder” to set the position of (the first window of process “Finder”) to { 50, 500}

I run this line as “MyApp 6.0”. “MyApp 5.5” is a previous version. I get the error that “myApp 5.5 is not allowed assistive access”.

1. Yes it is - it is checked in the Privacy pane. Both apps are checked.
2. I am not running “myApp 5.5”. No call is made to it. No calls at all are made from myApp 6.0. There is no reference to it. 6.0 is simply a replacement of 5.5.

Two more items to assist my access to insanity:
3. It has run twice between fails without the error, each time the error returned on the next run. So it’s not completely consistent.
4. Three times I have returned to Privacy to find myApp6 unchecked. I clicked the lock every time I checked it.

So Mac OS won’t run “MyApp 6.0” because a different app is not, except that it is, checked in the Privacy preference. And sometimes the app succeeds but it nearly always doesn’t.

Any help would be greatly appreciated.

Thanks.

My system is Hi Sierra 10.13.3

I have experienced similar madness with scripts claiming they aren’t allowed assistive access when they clearly are.

I’ve never gotten to the bottom of when/why this happens. But I have worked around it by creating a new file in Script Debugger, pasting my code from my improperly denied script in, saving it with an entirely different name, and giving that App access.

Clearly this should not be necessary, and maybe someone who actually knows what’s going on will enlighten us, which would be great. It must in some way come down to the question “how does assistive access identify an application?”

  • Tom.

By bundle ID. If the bundle ID is different or changed with the new version then it wouldn’t be recognised as the same.

Example of a what these look like in the Accessibility database:

[format]kTCCServiceAccessibility|com.latenightsw.ScriptDebugger6|0|1|1|˙fi|
kTCCServiceAccessibility|com.techsmith.camtasia2|0|1|1|˙fi|
kTCCServiceAccessibility|com.apple.ScriptEditor2|0|1|1|˙fi|
kTCCServiceAccessibility|com.apple.Safari|0|0|1||
kTCCServiceAccessibility|com.apple.AccessibilityInspector|0|1|1||
kTCCServiceAccessibility|com.apple.Automator|0|1|1||[/format]

Check what’s allowed in Assistive Access from Terminal (you’ll need sudo & admin password on 10.12 or later):

[format]sudo sqlite3 /Library/Application\ Support/com.apple.TCC/TCC.db ‘select * from access’[/format]

I wanted to update that I just had this exact same problem again, this time with FastScripts. FastScripts had an update, I installed it, and then any script run from FastScripts with UI scripting would get the error that FastScripts isn’t allowed assistive access.

I looked at the System Preferences, FastScripts is there, but has become unchecked. Check it. Run a script.

Still get the error. Close and reopen System Preferences, and FastScripts comes back up as unchecked again. I can check the box and close and re-open System Preferences over and over, and it always comes up as unchecked now. And even if I just checked it and it’s displaying onscreen as checked, I always get the error.

The workaround I found is this:

  • Quit FastScripts
  • click the “-” sign to delete FastScripts from the Accessibility list.
  • Click the “+” sign to add an app
  • Choose Fastscripts from the Applications folder
  • Check the box
  • Quit System Preferences
  • Launch FastScripts.

I didn’t experiment with all possible permutations of this, maybe some steps are unnecessary. But it did fix the problem.

I’ve had the same problem with an AS app, the error message that My.app isn’t allowed assistive access. The other thing that happened at the same time: When I placed the app into the Privacy pane, sometimes the name was altered, slightly - one character in the name was upper case when the app didn’t have an upper case or something similar.

I was able to fix it as follows. I used EasyFind to search my drive - and external drives - for all possible copies of the app along with slightly changed names (like using upper vs lower case or a dash in the name, etc.) Turns out, I found hundreds of files that had accumulated while testing it. I deleted the files or stored them on a drive that wasn’t mounted to my computer. The error message and the incorrect name problem both disappeared. In my case, this was mostly happening in Mavericks. My conclusion: (Because so many copies of the same app accumulated), when I thought I was placing my app into the Privacy pane, somehow it was grabbing another file. Don’t know if that’s what’s driving your problem - but it worked for me.