Script Editor Alternatives...

Apologies in advance should this not be the best forum to post this in but after looking at the other options this seemed like the best choice to me.

I am curious as to wether there are better / easier applications to write AppleScripts with over script editor and, in particular, as it relates to working with and understanding the various Dictionaries which I still find difficult.

Thanks,

Joel

I’m working mostly with SublimeText2. That is because I have to work with different kind of scripting languages (like PHP, JavaScript and Shellscript) but I also use ST2 for editing XML and HTML files. Code snippets are very useful, as you can change the language syntax to your likings and the code completion itself is pretty good. With ST2 you can add a build system and use osascript to compile and run your script.

Hello.

I think that the debugging capabilities is the most important property of an AppleScript Editor, especially, when one is new with the language. That is, the earlier in your careeer you invest in something that debugs, the greater the return.
I’d try ScriptDebugger if I where you, (free trial). I’d also read the AppleScript Technote: Debugging Magic, and see if you can live with the techniques that are listed in that technote, while you are using AppleScriptExplorer, which makes writing Applescript with AppleScriptObjC so much easier. You really want both, but both comes at a certain pricetag, since ScriptDebugger is rather expensive.

Appreciate the suggestion for ScriptDebugger…I will watch the tutorials and then try it for free but, as you note, it is not exactly inexpensive.

Thanks,

Joel

JoelC,

I’d agree with MacUsrII that debugging is most important, I also agree with you that Script Debugger is costly. However, what is your time worth? When you’ve spent several days looking for a glitch in your script is when Script Debugger suddenly becomes cheaper. I, for one, wouldn’t want to do without it.

That’s where Script Debugger really shines – it’s Dictionary Explorer is superb. There’s simply nothing else like it.

McUrsll, Av8TnTek, and Shane:

Though I have not had a lot of time since I lasted posted U have reviewed some of the video tutorials on the Late Night Software website and I am more or less sold – at least enough to give it a try before buying…that said, any suggestions on how to best use the software as it seems extremely flexible and extremely powerful meaning that a user really needs to know their way around it to get the most out of it.

While I will not argue – as you are all far more experienced than me in scripting – the thing that has me the most convinced to try it is the Dictionary and the drag and drop capability thereof because for whatever reason, I continue to struggle with this.

Thanks,

Joel

For starters, open an app you want to script, and open a couple of documents in it. Then go to SD, choose File → Open Dictionary… and choose the app, then at the top there’s a segmented control with Dictionary/Object Model/Explorer. Click on Explorer and go exploring. You can change any values that are not read-only here,

For scripting (high level) languages I don’t care much for debugging tools. There are a couple of reasons and the first is that in AppleScript it’s quite easy to write a script where version 1 is flawless, because most of AppleScript is RPC-like. Another reason, for scripting languages in general, is that a debugger is too complex for most bug solving. In most cases the error that will be thrown speaks for itself and you know instantly where and what the bug is. Then ScriptEditor highlights the line or even word that is causing the error (character range on command line). Last but not least the “hard” bugs can be found by event/manual logging very easy.

So to me it’s an obvious choice to use an editor that saves a lot of time writing code but without a debugger (since I don’t need one) rather than having an editor with an debugger but eventually increases my development time due to spending more time in writing code.

That may be so – but I don’t know that you’re at all the typical scripter, and certainly not a newcomer like the OP.

I’m probably not typical either, and I generally prefer the event log as first port of call when trying to track down a problem. But I still end up falling back to stepping through and watching variables often enough, and when I do, it saves not only time but precious hair. It’s the stuff that doesn’t throw errors that takes time debugging.

I interpreted the question as a more general question of interest. The “best” is here an opinion based question if you ask me. I’m not disagreeing with Av8TnTek or McUsr because the debugger can be the most important feature for them, there is nothing to argue about that. Just showing that the choice of editor isn’t debugger-based for everyone. I think that some long time scripters will eventually reach a point where debugging becomes less important because you almost never do it.

That is exactly my point when I wrote that the earlier you buy it, the more you’ll save. Because it may take some time to find the various patterns for the differenet bugs. So, you’ll save both time and spare yourself from agony, by having Script debugger, when you are new to this. And if you are bitten by the AppleScript bug, like of the compulsive sort, with an urge to automate whatever it is, then you obviously will pay a very meager price per hour of use, as the years go by, however how expensive the Script Debugger may seem for starters. :slight_smile:

Scripting is also much more fun with ScriptDebugger, because you don’t become stuck with some obscure error so easily.

Other hobbies, demands either scuba gear, a horse, car, or a shotgun, and in that perspective, Script Debugger isn’t so expensive after all.

I was glad I found Script Debugger.

Besides some of the points already mentioned I find the ‘Result & Variables’ panel a real time saver.
I also like being able to set up the typing shortcuts for code snippets etc.

Shane, DJ, et. al:

Appreciate all the responses and because i) I have been bitten by the scripting bug ii) I struggle with the Dictionaries’ use [which SD appears – at least on the video tutorials – to simplify through the provision of an object model and the provision of drag and drop coding] the use of SD appears to be a no brainer to me. So, as an AS newbie, I think this will be most helpful, likely even more helpful that the debugging capability.

One of the things I am actually frustrated with is not asking this question of starting this thread earlier as I likely would have saved myself a lot of frustration. Perhaps SD – or similar improvements over Script Editor – should be suggested to all new ASers?

When I get home – as I am now on vacation – I will download and start my free 20 day trialbut I cannot see myself not buying SD [assuming it provides the level of benefit it appears to through the video tutorials]. With the only possible issue being that fully leveraging the software could take some time given the user manual is close to 300 pages long.

Worth also noting is that while the software is expensive relative to other software I don’t find it unreasonable given i) the aggravation / frustration it will hopefully save ii) the amount of time I will spent scripting [i.e. on a cost / hour basis it is likely minimal similar to the price paid for MS Office which I use daily to earn a living] and iii) with respect to a hobby, it is cheaper than most!

Once again, thanks to everyone for being so helpful.

No question. But then I think SD is no slouch as an AppleScript editor.

I can sort of understand your preference for a single editor you can use in lots of languages, but for those not dealing in lots of languages, a single place where you can edit, debug and examine dictionaries seems to me to make sense.

Having said that, I only code in Objective-C/C and AppleScript, but the idea of using the same app for both frankly scares me. Indeed, I’m happier using two editors for AppleScript alone, depending whether it’s ASObjC-based or not.

ROTFLMAO!

After 20 years of writing AppleScript I’m still debugging. :cool:

AppleScript’s error-messages are grotesquely uninformative, but if your understanding of them has become instant then more power to you.

The Applescript Editor has always been weak and wobbly. Even after all this time it lacks features that no self-repecting programming-editor should be without.

Biting the bullet and spending the not insubstantial bucks for Script Debugger v1.0 (about $129.95 in 1995 US Dollars) has saved me thousands of hours, thousands of dollars, and reduced mightily the aggravation of wrestling with many a complex AppleScript dictionary. (I have upgraded every time through v5 as well.)

Find/Replace with regular expressions is worth a lot to me.

The Dictionary-Viewer, Object-Model-Viewer, and Dictionary-Explorer make the Applescript Editor’s dictionary-viewer look like a preschool toy.

Knowing what code executed and what code didn’t is a joy.

Being able to step through a script and watch variables live helps one to learn AppleScript and makes it much easier to solve many problems.

Knowing exactly where an exception took place. Priceless.

When I’m deep in a multi-thousand-line script and something isn’t going right it’s a relief to be able to set a breakpoint and step through the code causing the exception. Seeing the data-flow live often reveals the cause of a problem in a few seconds instead of a few minutes (or more).

Walking through a complex series of regex find/replace operations and watching the results can quickly reveal order-depenency problems.

.

Can you get by without Script Debugger? Sure.

Do I want to live with a grotesque loss of productivity? Not on your life.

It is more that E.W. Dijkstra programmer’s discipline helped me than remembering error messages :slight_smile:

I am back home now and will embark on my next script within the next few days so will have some first hand experience to share with other on SD…thanks to all!

Hi Joel,

A few AppleScript debuggers are builtin in the Standard Additions scripting additions. You can use various forms with ‘beep’, ‘say’, ‘display dialog’, ‘try’, etc… These commands and probably more give you feedback. You need to do a little more thinking about what the feedback means, but AppleScript is not that complicated.

A good question might be a post where someone wants to know various forms of debugging with what you’ve got especially if you’re on a tight budget.

gl,
kel

Appreciate this and note that I have used these extensively to test various blocks of code as I am writing my scripts…that said, the related message, even with the list of error codes which I have, are not always useful!

Noted…I will try SD within the next few days once the madness of being at work settles down but please recall that I am beginner at this — only being doing this for to 8 weeks – so I think SD’s dictionary and drag and drop coding for accessing various object is going to be more helpful to me than its debugging capabilities, at least at the start!

Joel