Dyce & Sons Ltd.

Helping IT since 1993

Script Debugger 3.0.1

Wednesday 28th November, 2001

When we reviewed Script Debugger 2.0 (see Reviews, 24 November 2000, p30), we had one small criticism - it wasn’t Mac OS X ready. The team at Late Night Software (LNS) have been hard it and Script Debugger version 3.0 has been released for Mac OS 8.1 to OS X 10.1.

Unlike some Carbonized applications, this version isn’t just a port of the current feature set to OS X - it’s a feature-laden upgrade which serious scripters will love.

Version 2 provided AppleScript programmers with a proper scriptable editing environment and debugging tools and LNS has greatly improved these in version 3.0.

Debugger 2.0 had its own Open Scripting Architecture (OSA) component. You could write scripts in AppleScript and, provided you had set the OSA component in the script window, your script would be executed using the debugger. This allowed you to debug scripts running in other applications and have them drop into Script Debugger when they hit a problem or breakpoint. However, to do this you needed to have Script Debugger running at the same time. In version 3.0, the OSA component is now standalone, so you don’t need the application running to run scripts written with the debugger dialect.

The debugging tools have also been supplemented. There’s now a trace command, so you can have your code stepped through one line at a time without continuous mouse clicks. There’s also a new Console palette, which allows you to execute commands within the context of the current script. In other words, you can invoke handlers within your script from a command line.

The in-execution tooltips let you see the value of an expression by selecting it and mousing over it, and there’s now an Expressions palette, so you can do calculations based on the current state of a running script. Talking of which, you can now have Debugger Break on Exceptions, which will pause whenever it enters an On Error block.

Tales from the script

Editing tools have also been beefed up. For those who go in for code-reuse using libraries in scripts, there’s a Flatten Script command that rolls the code from any included libraries into your script. This is great if you want to give the script to someone else. The new ‘code coverage’ feature in the debugger uses simple highlighting to indicate which lines of your code have been executed. This means you don’t have to include parts you don’t need.

If you’ve made use of Scripting Additions (OSAXen), you can use the Script Manifest to list which additions they are, and check to see if they’ve been updated by searching the www.osaxen.com online archive. If you want to publish your scripts online, you can export them as HTML.

While the text editor has had a few tweaks (BBEdit-style key modifiers and customisable command keys for all commands), Debugger 3.0 has followed the trend set by such HTML editing tools as Dreamweaver, by allowing you to switch into BBEdit and edit your scripts using its more powerful tools such as grep. And for the real nerds who want to script the editor itself, version 3.0 is more scriptable than version 2, with expanded script property and handler classes.

Even if these were the only improvements made since version 2, you’d have reason enough to upgrade. However, having already written one OSA component, LNS has gone one better. Debugger now ships with a JavaScript-flavoured OSA component. Instead of scripting your applications in AppleScript, you can write your scripts using a mainstream, well-supported, powerful language.

Hot Java

JavaScript has a number of advantages: it’s cross-platform, has an easy-to-learn syntax (very much like C), is object orientated, and is dynamic in nature (coerceable, non-strongly typed variables, lexical scoping for names, ‘eval’ type operations on strings, runtime parameter evaluation for functions, dynamic object properties and so on). Of course, most JavaScript programmers run their scripts within a browser, using the Document Object Model. This isn’t available for scripting - instead, LNS has provided two new models, the Core object and the Mac OS object, which let you get at applications such as the Finder using standard JavaScript object methods.

The JavaScript OSA implementation isn’t complete yet, but LNS has provided the first useful OSA alternative to AppleScript. If you’re a keen scripter and want to script OS X, or if you know JavaScript but couldn’t get into AppleScript, then you need this upgrade.


If you’re a keen scripter and want to script OS X, or if you know JavaScript but couldn’t get into AppleScript, then you need this upgrade

Get Further Info
Rating 4.5
Manufacturer Late Night Software
Pros Improved debugging and editing + Standalone OSA component + BBEdit integration
Cons JavaScript implementation not fully complete yet
Price 189
Originally Published MacUser, Volume: 17, Issue: 22, p40