How to debug an Action recorded script while it's played back?
Hi,
I've built several scripts that leave traces in Actions – also blogged about this in the past (see here).
Now I find myself in need to debug the action called script, and can't find a way – let me explain the whole thing.
I had an action-recordable script (with dialogs, etc) that worked flawlessly, let's call this version A.
I've almost entirely refactored the code and built version B.
The issue is that apparently both A and B successfully leave traces in the Action Palette, but when I play the recorded action (and so I call the B script) nothing happens, there's something wrong. Since the two <javascriptresource> sections of A and B are identical, I can't test them together, but I have to keep just one of the jsx in the Presets/Scripts folder and temporarily move out the other one.
The weird thing is that if I record the action running the latest, buggy version B, and then play it back when the version A file is in place, the routine is performed successfully! But recording with B, and playing B leads to nothing. So I would say that the error lies somewhere after this check in version B:
var isFromAction = !!app.playbackParameters.count;
if (isFromAction) {
// stuff here
}
I would debug that in ESTK (the code is a bit entangled), but I've found no way to pop up ESTK, "debugger;" doesn't work.
Any suggestion?
Thank you,
Davide Barranca
