DT4 - debugging scripts - improved debugger

For me, DEVONthink serves as my automated document process manager. What I have longed for, however, is a truly superb debugger.

Do, what I would truly appreciate would be a robust runtime debugger for my “internal” scripts - maybe even integrated into DEVONthink like an streamlined, stripped down VS Code.

  • AppleScript
  • JavaScript for Automation (JXA)

For AppleScript, I have been utilizing the Script Debugger (Retiring Script Debugger | Late Night Software). Regrettably, it will be discontinued as of June 2025.

For JXA, I have yet to discover a suitable alternative to the Script Debugger - Introduction to JXA | JavaScript for Automation (JXA). Indeed, there seems to be a dearth of quality options, which has consistently deterred me from dedicating time to these scripts.

At a minimum, the debugger should offer the following capabilities:

  • Real-time analysis of scripts
  • Display of variables and their corresponding values
  • Terminal access

This is far outside the scope of the application. DEVONthink is not a code editor and there are already methods for debugging scripts externally.

One question about Script Debugger. It will not be sold or maintained but the program will work, correct? While I understand that looking for alternatives might be wise it probably will work until something changes with AppleScript?

We can’t speak on behalf of Mark or Shane. As far as an alternative, what’s wrong with Apple’s built-in Script Editor? I have used it for 30 years and is my constant go-to.

There is none. I use console.log calls mostly. Script editor to follow program logic.
For the rest, I agree with @BLUEFROG – DT is not an IDE.

A lot. And it’s not a debugger – no breakpoints, no watched variables, no stepwise execution… The editor is lacking mostly everything a modern editor offers. But Applescript is also lacking many features of a modern language …

I used it for 25 years from multi-billion dollar, multi-national corporations down to mom and pop shops, on projects from a few hundred dollars to several million. Script Editor is more than adequate in the real world.

I don’t doubt that people use it.

Your question was, what is wrong with it. I was responding to that.

Since script editor was the only tool for AppleScript, does not mean it is a good tool because projects were realized with it.

Ok. I can understand that. What I really miss is a log (file) where I can see my scripts outputs (in “production”. That would be helpful as well.

Script editor.

I know and I’m using this extensively. I just prefer to be able to look for logs in case something went “wrong” in “production”.

try … catch?

1 Like

The DT documentation makes specific reference to Ai assisted scripting. I haven’t experimented with this as yet, but it will be interesting to see whether a particular LLM has greater abilities with JXA over AppleScript. This is no more than an assumption on my part, but I’d expect that JXA may be more LLM copilot friendly simply on the basis that the JavaScript training corpus is going to be far larger than that for AppleScript. The DT script dictionary is extensive for both languages, so that should help with specificity.

While that is true, there’s not much JXA code available on the net for AIs to steal train. And what I’ve seen on the forum as output of AIs makes me cringe reliably. Better learn how to write code yourself.

2 Likes

The section you’re referring to is not about using AI to create scripts. It is about AI-driven options like the Chat Query smart action and AI-specific script commands.

Apologies, the dangers of misreading the documentation and not paying attention to context!

Not a problem. Just clarifying for the passers-by, especially as AI generally produces rubbish AppleScripts.

3 Likes