We are pleased to announce the Beta version of Script Debugger 8. Script Debugger 8 builds are announced through the Beta Testing category of the Late Night Software support forum.
We deeply appreciate the time you spend helping test Script Debugger. Script Debugger would not be the product it is today without the contribution of so many of our customers over the years. Thank You!!
26th Anniversary Edition
The release of Script Debugger 8 marks Script Debugger’s 26th anniversary as a continuously developed indie Mac application.
Script Debugger 8 requires macOS Big Sur, macOS Catalina or macOS Mojave. Script Debugger 8 supports macOS Big Sur on Intel and Apple Silicon processors natively.
Script Debugger 8 Beta accepts Script Debugger 7 registration numbers. Note that the release version of Script Debugger 8 will be a paid upgrade. Script Debugger 8, like Script Debugger 7, operates in lite mode if you don’t have a Script Debugger 7 registration number.
Script Debugger 8 builds are posted periodically to the Beta Testing category of the Late Night Software support forum.
Download and open the Script Debugger 8 build (distributed as a
.dmg file), and then copy the Script Debugger application to your
/Applications folder (or any other place on your system).
NOTE: Automated software updates are available within Script Debugger 8 with build 8A13 and later.
Script Debugger 8 Beta builds expire. This encourages testers to keep up-to-date and ensures that beta builds of Script Debugger do not remain in use once the beta period ends. Please ensure you download new Script Debugger 8 Beta builds as they become available.
IMPORTANT – File Format Change
SCRIPT DEBUGGER 8 BETA SHOULD NOT BE USED WITH PRODUCTION SCRIPTS.
Please be aware that Script Debugger 8 introduces significant changes to the way documents are saved, particularly when debugging is enabled. We strongly recommend that you use Script Debugger 8 on copies of important documents to ensure you can recover if your documents become damaged.
Documents saved with Script Debugger 8 are backward compatible with Script Debugger 7 and Apple’s Script Editor. Note that some settings may be lost when moving backwards from Script Debugger 8 to Script Debugger 7.
Script Debugger 8 removes the notion of external debugging. As a result, documents saved by Script Debugger with debugging enabled no longer depend on the Script Debugger OSA component. See the external debugging section of this document for more information.
When you find an issue with Script Debugger 8, please post it to the Beta Testing category of the Late Night Software support forum.
Please ensure you are running the latest Script Debugger 8 beta build (use the Check for Updates command in the Script Debugger menu to get the latest build).
Please include a description of the bug and, whenever possible, steps to reproduce the bug. Screenshots and/or movies illustrating problems are always welcome.
Please include the Script Debugger build number, the version of macOS X you are using and the CPU type of your Mac (Intel/Apple Silicon).
Please report one issue per forum topic. We will endeavour to link back to corresponding forum topics in release notes when we resolve issues.
Script Debugger Settings
Our practice with major Script Debugger releases is to not share settings and preferences between Script Debugger versions. When you first install Script Debugger 8, it will import some settings from a pre-existing Script Debugger 7 installation and then operate independently.
~/Library/Application Support/Script Debugger 8 folder will be created to hold templates, scripts, clippings, etc. Script Debugger 8 preferences changes and changes made within the
~/Library/Application Support/Script Debugger 8 folder are not shared by Script Debugger 7.
The following is a summary of the changes in Script Debugger 8. Additional information is available through the Script Debugger Beta category of the LNS Support forum. Specifically, these posts:
- Where Did It Go?
- Scripting Tabbed Windows
- Bundle and Export Settings
- Direct Export
- Script Libraries
- Line-Break Changes
NOTE: the Help information under the Help menu has not yet been updated, and still displays information for Script Debugger 7. It will be updated closer to the release date.
Script Debugger 8 runs natively on Apple Silicon Macs. Additionally, when running on Big Sur, script applications created with Script Debugger 8 run natively on Apple Silicon. Note that there are code signing and other considerations when creating script applications on Big Sur. See Big Sur: Lost Properties for more details.
Big Sur Appearance
Script Debugger 8 adopts the Big Sur appearance when running on Big Sur systems.
Big Sur’s window title design reduces the amount of space available for toolbar items. Script Debugger 8 alters the default toolbar configuration when running on Big Sur to accommodate this change. Note that if you are upgrading from Script Debugger 7 your toolbar customizations will not be carried forward to Big Sur and you must re-apply your customizations manually.
The script timer has been redesigned for Script Debugger 8 to use less space in the toolbar. The timer now has two modes: Timer and Stats. You switch between modes by clicking the timer.
Script Debugger 8 adopts the standard macOS tabbed window appearance and behaviour.
Script Debugger 8 is consistent with all other macOS applications supporting tabbed windows. You can drag within a window to re-order or between windows. Tabs can be dragged out of windows to create new windows. There are additional menu comments in the View and Window menus.
Show All Tabs:
Script Debugger 8 fully supports Dark Mode. This applies to user interface elements and script text formatting. Please see the Themes section for details of how Script Debugger accommodates Dark Mode/Light Mode transitions.
Script Debugger 8 introduces the notion of color themes. Themes are used to change script formatting when switching between Light and Dark mode, or simply to provide alternative formatting options. Please see this forum post for further details.
Script Debugger 8 allows you to configure your Sparkle app cast settings when generating enhanced script applications.
The Script Debugger 8 preferences panel has been redesigned to facilitate searching for preferences settings.
Building Preferences Panel
Script Debugger 8 introduces a new Preferences panel, Building. Much of it relates to the Direct Export feature, and is covered here. However, there are two other important settings.
Under Saving Applets, there is a checkbox,
Lock main script. When this option is checked and you save an Apple Applet document where Persistent Properties is disabled, the applet’s
main.scpt script file’s permissions will be set to read-only, to prevent it from being modified when run.
This is unnecessary for Enhanced Applets, and applets that are saved under Big Sur and not intended to be run on earlier versions of macOS. However, if you are saving applets in Big Sur and distributing them un-notarized to users on earlier versions of macOS, this will stop them from being modified when run, and hence having broken signatures, in such cases.
This file locking occurs automatically when exporting an applet signed to run locally, regardless of the setting.
The second option, under Saving Script Bundles, is the checkbox
Save .scptd files in version-control-friendly format. This is an option designed for those who use version-control systems. The explanation is a bit technical, so if you don’t use such a system, feel free to ignore it.
The problem with AppleScript and version-control systems is the source is stored in compiled form, unless you save as text. But when you save as text, handling projects that involve other resources becomes more complicated. And document-level settings become more fragile.
With this setting, you can save files in
.scptd form, and still peruse — and modify — source code in version-control systems. The code is still stored in compiled form, but it is also stored in .rtf form, and when documents are opened, the .rtf form takes precedence.
This scheme takes advantage of changes Script Editor introduced when it converted to autosave. If, in System Preferences, you turn off the option to ask whether to keep changes when closing documents, you can see it in action. Make a change to a Script Editor document so that it cannot compile, then quit the application. You can then open the document — in Script Editor or Script Debugger — and the change will be present (with the document marked modified in the case of Script Debugger).
What happens in this case is that Script Editor saves the last compiled version of the script in the bundle’s compiled
main.scpt file, and then saves the current source in a file called main.rtf, in the same directory as
main.scpt. When you open the document again, the editor first looks for a main.rtf file, and falls back to the
main.scpt file if it is not found.
In Script Debugger, the facility is used a bit differently. Code that will not compile still cannot be saved, but when this option is on, the same code will be saved in both
main.rtf. This means the code in main.rtf can be read, and edited, in a version-control system — it will have precedence when the script is next opened. The only requirement is that any modifications will need to be followed by a recompile before the script is deployed.
In combination with the new Direct Export feature, it can make things more streamlined in some situations.
The biggest are of change in terms of scripting is in access to window tabs (this is covered in some detail here. But there are also several other scripting changes.
The application object has several new properties, and loses some others. With the introduction of Color Themes, the
apply handler formatting,
handler color, and
script background color properties been removed. The
AppleScript format class is also no longer relevant, so it is no longer an element of the application.
Script Debugger now supports searching, via the
search command, with relevant application properties
search uses regex,
search matches words,
search ignores case and
search wraps. You also set the search and replace string via application properties:
search string and
search replace string.
open in tabs property has been deprecated, in favour of the
prefer tabs property, which lets you choose whether to follow the system setting or override it.
Other new application properties are
can notarize, which tells you if the Mac meets the requirements for notarizing apps, and several properties that cover settings in the Preferences -> Building pane:
copy notes file, which reflects the setting for the SD Script Notes.rtfd file;
export destination fixed and
export folder name, for controlling where exported files end up;
lock applets, which controls whether applets are locked; and
version control friendly, for scripts saved as script bundles.
You can get a list of available themes through the
available themes property, and get or set the active theme via the
current theme property. And the application no longer has an
AppleScript formats collection.
document class has some new properties:
autoincrement build number on export joins
autoincrement build number;
embed run only and
embed used frameworks join
embed used libraries for exports;
export name gets and sets the name used used for exported files; and
local codesigning controls whether to sign to run locally when exporting apps.
codesign identity and
codesign on export only properties are no longer applicable, and have been removed.
There is a new command,
direct export, which provides access to the new Export Run-Only facility. You pass the document as the direct parameter, and the script type for the
For the past several versions of macOS, all applications, including AppleScript applets, need to be notarized to be approved by Gatekeeper. Notarizing requires membership of Apple’s paid developer program, and involves code-signing with a special identification certificate, plus submission to Apple for scanning for malware.
Script Debugger does not directly support notarizing, but instead links with Late Night Software’s free SD Notary application. If Script Debugger detects that you have a valid Developer ID certificate, a copy of SD Notary, and meet the other requirements for notarizing (including having a recent version of Xcode installed), when you export an applet, the dialog will include an extra button, Notarize.
When you click this button, the file will be passed to SD Notary, where you can customize the app’s entitlements if required, and press Submit to submit it for notarizing.
Bundle & Export Settings
Script Debugger 8 introduces the Bundle & Export Settings dialog which combines various previous settings, and some new ones, in one place. Please see [this forum post for more details](SD8: Bundle & Export Settings.txt https://forum.latenightsw.com/t/sd8-script-libraries/2851).
Build & Export Settings:
Build & Export privacy Settings:
Build & Export Advanced Settings:
Script Debugger 8 simplifies exporting of run-only scripts by making it a one-step process, which we call Direct Export. It’s part of a suite of changes to help users better manage scripting projects. As the requirements for scripts become more complicated with issues like code-signing and notarizing, these changes make it more convenient to separate the development and deployment processes. Please see this forum post for more details.
Persistent Globals Removed
The Persistent Properties option in the Script menu has been removed. As of Script Debugger 8, properties and top-level values never persist: when you run or save a script repeatedly, these variables will contain their initial compiled value, if any. Please see this forum post for more details.
View Libraries and SDEFs in Dictionary Window
Support for viewing Script Libraries in Script Debugger 8’s dictionary viewer has been expanded. Please see this forum post for more details.
Script Debugger 8 has transited to using linefeeds for line breaks. Please see this forum post for more details.
Open Used Dictionary
You can place the cursor on a
use script statement and use the Open Dictionary (Comand-D) command to summon the dictionary associated with the script library.
Script Debugger 8 introduces several line-based editing commands, for those who don’t like to take their hands off the keyboard.
The Edit menu has a new submenu, Lines. This contains several line-based commands from previous versions: Shift Left, Shift Right, Comment, Uncomment, Entab, and Detab. There are also four new commands:
Move Up. This moves the line or lines containing the selection up one line, to before the line that precedes them. The formatting and selection within the moved lines is retained through the move.
Move Down. This moves the line or lines containing the selection down one line, to after the line that follows them. The formatting and selection within the moved lines is retained through the move.
Insert Line Before. This inserts a line before the line containing the selection, gives it a similar indent, and moves the cursor into it, ready for typing.
Insert Line After. This inserts a line after the line containing the selection, gives it a similar indent, and moves the cursor into it, ready for typing.
There are also four new commands in the Edit menu itself:
Cut Lines. This is similar to the Cut command, except it cuts the line or lines containing the selection, and not just the selected code itself.
Copy Lines. This is similar to the Copy command, except it copies the line or lines containing the selection, and not just the selected code itself.
Delete Lines. This is similar to the Delete command, except it deletes the line or lines containing the selection, and not just the selected code itself.
Duplicate Lines. This duplicates the line or lines containing the selection. The duplicated text is then selected.
All these commands support Undo, and you can assign them keyboard shortcuts by going to the Key Bindings panel in Preferences.
When pasting a command template from a dictionary, new pickers are provided for enumerations.
For example, BBEdit’s
change case command accepts a parameter named
making which is an enumeration. If you use Script Debugger to paste BBEdit’s
change case command into your script, you’ll see this picker for the
Script Debugger 8 allows you to create custom pickers within clippings.
Script Debugger’s Clippings facility works with plain text documents, using a simple tag mark-up scheme to implement various substitutions and the use of placeholders. Pickers are a special kind of placeholders: if you select them and type return or escape, a menu pops up, allowing you to pick a value to use.
Script Debugger has implemented various pickers: for applications, script libraries, frameworks, and a couple of other. Script Debugger 8 introduces user-defined or custom pickers, where you can set the contents of the menu your self.
At its simplest, a custom picker is defined using tags like this:
template signifies it’s a kind of placeholder,
custompicker defines the type, and then come the title and any entries, with all values separated by colons.
You can also create a picker where the menu items show one thing — perhaps an abbreviation or label — with different content to be inserted. You do this by alternating the labels and values, and ending the list with a final *, like this:
Using this form, you can insert separators into the menu by using empty label and value strings like this:
In this case a separator between the 1 and 2 entries.
You can also disable labels so they act as subheadings by setting their inserted value to *, like this:
In this case, the label 2 will be dimmed and disabled.
This alternating form can also support AppleScriptObjC enums and constants by appending **e or **c to the end of the relevant value to be inserted:
[[template:custompicker:Picker title:is an app:NSURLIsApplicationKey**c:is background:NSActivityBackground**e:*]]
This supports the usual property insertion if
Use Properties for Cocoa Terms is on, otherwise it prefixes the name with "current application’s “”.
External Debugging Removed
Script Debugger 8 no longer offers external debugging. External debugging was a facility where scripts saved with debugging enabled, and invoked from other runtime environments (e.g. Folder Actions, etc.) would be debugged within Script Debugger. Security changes introduced in macOS Mojave and later rendered this feature inoperable so it has been removed.
A benefit of this change is that all documents saved with Script Debugger 8, regardless of their debugging state, are saved as standard AppleScript scripts. This makes all Script Debugger documents fully interoperable with any other application that reads AppleScript files.
«class furl» File References
Script Debugger 8 offers a new option for inserting «class furl» file references when files are dropped into the script editor. Additionally, the drop file dialog now presents the options as a list rather than radio buttons, enabling keyboard navigation.
New Controls for User Clipping and Script Presentation
Script Debugger 8 introduces additional control over how user defined clippings and scripts are displayed in their corresponding menus:
Add library use statement when pasting code
When using Paste Tell/Paste Code with script libraries, a use script statement will be inserted if it hasn’t been already.
A viewer for examining NSColor objects has been added to the debugger.
Text Substitutions Storage Changed
In previous versions of Script Debugger, Text Substitutions were stored in the user’s preferences for the application. Script Debugger 8 stores them in a separate file,
~/Library/Application Support/Script Debugger 8/Text Substitutions.plist, making it less fragile and simpler to transfer between Macs.
Resources List Now Contents
In previous versions of Script Debugger, the Resources Pane displayed the file hierarchy in a bundled script’s
/Contents/Resources directory. Script Debugger’s display has moved up the hierarchy, displaying the contents of the
/Contents directory. This simplifies things like adding frameworks to script applications…
Smarter Library Picker
Script Library pickers now check if the relevant
use statement declares a variable that refers to the library, and if not, only displays libraries that contain scripting dictionaries.
Autosaving is faster, and more reliable. It now also handles scripts with top-level AppleScriptObjC values.
AppleScriptObjC completion has been improved, and more frameworks are supported.
Script Debugger 8 includes several new and refined clippings.
Clippings, Scripts Menu Access
Script Debugger 8 has removed modifiers that cause clippings and scripts menu items to to invoke alternate actions such as Edit or Reveal in Finder. This avoids conflicts with other modifiers assigned to scripts and clippings, and frees up more shortcut combinations.