smizzlov
smizzlov

Reputation: 608

Call stack of AppleScript

Is there a way to see something like a call stack when executing an AppleScript?

I am using functionality from an AppleScript library in my regular AppleScripts. Sometimes the script renders an execution error, but it's not always clear which handler failed.

A call stack would be very helpful with this. Or are there other good debugging strategies?

Upvotes: 1

Views: 82

Answers (3)

regulus6633
regulus6633

Reputation: 19032

The easiest way to see what is happening is using the events viewer in Script Editor. At the bottom of your code window where you see the result, you can change that view to show events. The events will detail each line of code as it runs essentially showing you a basic call stack.

Good luck.

Upvotes: 1

matt
matt

Reputation: 535047

What you want is Script Debugger. It will display the call stack and much more (you can pause at breakpoints, inspect your variables, etc.). It costs money, but you can try it out for free, and if you're going to do anything more than the pure basics, it's worth the price. [Disclaimer: I am not a disinterested party; I wrote the manual, and was paid to do so.]

Upvotes: 1

pbell
pbell

Reputation: 3095

Applescript has very limited features. Basically you can use display dialog to check value or the log function (but log only works if you are running in Applescript editor). It is of course also possible to log in text file and let the file open using quickview

Upvotes: 0

Related Questions