Apple Event: May 7th at 7 am PT

Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Specific Applescript commands stopped executing in 10.9 Mavericks On Quit handler

All commands in the following Quit handler have been working well as part of a larger script/application in a 10.7 environment, but in 10.9 most (but not all) of the commands stopped working:


User uploaded file

All required variables in the above handler are provided as globals. ALL commands work as expected when run from the Applescript Editor in 10.9. The script is then saved as a stay open application (due to an idle handler). Here's where it gets funky. When the application is run and and Quit is attempted, the first 2 commands in the TELL block execute, but all others commands before and after do not appear to execute and the application does not Quit. However, when the same application is run in 10.7 it works perfectly!

Note that the application is enabled for Accessibility in 10.9.

Setting the Gatekeeper to allow apps from "Anywhere" did not help

Any ideas what's causing the difference in 10.9 and how to fix it?

Posted on Jul 31, 2015 8:43 AM

Reply
2 replies

Aug 4, 2015 12:20 PM in response to red_menace

Thanks for the reply Red Menace. Re entering actual code. I considered doing this but I could not find an option for Applescript, though there was the ability to enter python, ruby, java, etc. Am I missing something?


Re the actual issue. It may have been solved. As I mentioned, the application created by Applescript was listed as having access to Assistive Devices/Accessiblity in 10.9, i.e. the app's box was checked in System Pref > Security/Privacy > Privacy pane. Despite that, most of the commands that were not running seemed to require Accessibility. I noticed the app's name as listed in the Privacy pane often included a large number code for the bundle identifier whereas all other apps had something close to the app's actual name. The name as listed also seemed to change with the non-funtioning app. When probing the SQlite database where this info is maintained, I noticed that the access settings are either 0|0|1 (box unchecked) or 0|1|0 (box checked) for most apps. However, for the nonfunctioning applescript app it was often different, e.g. 1|0|1. Basically, the access to Assistive devices was not stable, for some reason.


The other oddity is that the problem only appeared on 10.9, not 10.7. The applescript code was developed on 10.7 and converted to an app on 10.7, then transferred to a 10.9 machine. So I re-built the app package on 10.9 ---- Problem solved! (So far, anyway). The app generate a bundle identifier based on its name, has stable access to Assistive Devices and executes as expected.


Question: Does anyone know where I can find a description of the possible permutations of the 3-code SQlite accessibility option, , i.e. the last 3 numbers in the SQlite file:

kTCCServiceAccessibility|<bundleidentifier>|0|1|1

Specific Applescript commands stopped executing in 10.9 Mavericks On Quit handler

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.