Script Debugger and Mojave

As a Script Debugger user you will notice several changes when you update to macOS 10.14 Mojave. You should first ensure you are using version 7.0.4 or later, for greatest compatibility.

**NOTE**: The contents of this post will evolve as we learn more after Mojave has been released.

**NOTE**: This post refers to Script Debugger 7.0.4 which is currently in beta testing. If you are using a Mojave beta release and would like to use Script Debugger 7.0.4, please [contact us](https://forum.latenightsw.com/t/beta-testing-script-debugger/525) to become a beta tester.

## Dark Mode

Script Debugger does not yet support dark mode. If you choose Dark Mode, Script Debugger will appear as usual. However, you can use Script Debugger’s control over interface color to set the script and background formatting used to edit and display code.

## Scripting Additions

Non-system scripting additions are no longer supported by Mojave, so Script Debugger will not display them in Dictionary view. When you edit existing scripts, commands from such scripting additions will appear in raw chevron syntax. Provided they were last saved in Script Debugger, you can use QuickLook in the Finder to see the original terminology. You can still view a scripting addition’s terminology by opening it directly in Script Debugger.

## Full Disk Access

By default, applications no longer have access to some files. For example, access to files containing your emails, or to Safari files, and many of the files in the Home and Library folders, is no longer freely available to applications. These new restrictions do not directly affect Script Debugger, but they limit the access of any scripts you write and run — you will receive an error if you try to access a file where you do not have permission.

If you need greater access, you need to grant Script Debugger Full Disk Access. You do this by going to System Preferences, finding the Security & Privacy panel, and clicking on the Privacy tab. In the left column you should click on Full Disk Access, and any applications that have been granted (or later denied) this permission will be listed to the right.

You may need to click on the lock icon at the bottom-right of the panel before you can make changes. This will prompt you for an administrator’s name and password. Once you have done that, you can add or remove applications using the + and buttons.

Any applets you create may also need to be granted Full Disk Access using the same process. If they are modified, access may need to be renewed.

Applications granted extra file access.

## Permission to Control

The first time you run a script that addresses an application, you will be asked to grant your permission. If you do not, the script will not run. Script Debugger’s Dictionary Explorer works by sending Apple events to applications, so you may be asked for permission when exploring an app’s dictionary, rather than directly running a script.

The Apple event permission dialog.

Once you disallow permission of a particular application, future attempts to script it or explore it in Script Debugger’s Dictionary Explorer will result in errors (the relevant error number is -1743). To change this, you need to go to System Preferences, find the Security & Privacy panel, and click on the Privacy tab. In the panel on the left you should click on Automation. You may need to click on the lock icon at the bottom-left of the panel before you can make changes. Scroll through the list on the right until you find Script Debugger, then use the checkboxes to enable/disable scripting of particular applications.

Controlling which apps can be scripted.

## Differences From Script Editor

Because Script Editor is part of system software, it does not require permission to address applications. However, Script Editor will not let you use third-party frameworks via AppleScriptObjC, or use script libraries that do so, whereas Script Debugger has no such limitation.

## Workarounds and Trouble-Shooting

The new restrictions are an extension of the System Integrity Protection scheme first introduced in macOS 10.11 El Capitan. It is possible to disable SIP, in which case the above restrictions will not apply.

You can reset to default settings using the command line tool `tccutil`. To reset the Automation privileges, run this in Terminal:

“`
tccutil reset AppleEvents
“`

To reset the Full Disk Access privileges, run this:

“`
tccutil reset SystemPolicyAllFiles
“`

These commands are all-or-nothing — you cannot remove the privileges for just one application.

For further details on the changes in Mojave, see here.