GUIScriptingChecker is an AppleScript library to check availability of “GUI Scripting”.Also if “GUI Scripting” is not enabled, GUIScriptingChecker can guide a user to enable “GUI Scripting” with displaying proper messages.
The default status of “GUI Scripting” is OFF.Therefore availability of “GUI Scripting” should be confirmed at the beginning of the script and a proper guide should be provided if needed.
The GUIScriptingChecker can help to perform such boring routine task with minimum efforts.
In OS X 10.9 or later, the following dialog will be displayed when “GUI Scripting” is OFF.
By clicking “Open System Preferences” button, the Accessibility section in the Security & Privacy preference pane in System Preferences will be opend.Your script can not continue to work, because “GUI Scripting” can't be enabled by a script.
In OS X 10.8 or before, the following dialog will be displayed.
If a user pushes “Enable GUI Scripting” button, “GUIScriptingChcker” try to enable “GUI Scripting”.If “GUI Scripting” is enabled through authorization process, the script can contiue to work.
Messages are displayed when “GUI Scripting” is OFF can be localized by giving a delegate to "GUIScriptingChecker" as follows.
Make a copy of an instance of GUIScriptingChcker
Check availability of “GUI Scripting”
set a delegate script
Obtain message texts from "Localizable.strings" in the resource folder in the current bundle.
A delegate script is used for localizing messages in a dialog shown when GUI Scripting is disabled.
Return a label text for “OK” button.
Return a label text for “Cancel” button.
Return a title text for a dialog.
Return a detail message for a dialog.