Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
0

How to debug an Action recorded script while it's played back?

Advocate ,
Jul 01, 2016 Jul 01, 2016

Copy link to clipboard

Copied

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

http://htmlpanelsbook.com

TOPICS
Actions and scripting

Views

666
Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe
Community Expert ,
Jul 01, 2016 Jul 01, 2016

Copy link to clipboard

Copied

If the<javascriptresource> sections of A and B are identical,sections of A and B are identical, that would make the names identical. When you record an action step that uses a script that has a <javascriptresource>  all the gets recorced ins the action step is the javascriptsource name which you can see in the action step. The may also be  unseen in the action palette an <eventid>uuid4</eventid>.  If the Script is a plugin script like Fit Image the Plug-in script may also record the dialog setting used while you recorded the action step.  When played the Plug-in script bypasses displaying it dialog and uses what is recorded in the step unless you turn on the steps dialog.  The Image Processor Pro is a Plug-in script when you record it in an action step.  The step looks empty in the action you see nothing.  But it works.

If A and B have identical <javascriptresource> names and eventid I think you have a problem on you hands.

My  Photoshop menu File>Automate>   has two Fit Image entries.  one in with my Plug-in scripte and the other is Adobe Fit Image.   My Fit Image

<javascriptresource> is identical to Adobe Fit Image with the exception of the UUID.  My Fit Image  file name is not "Fit Image.jsx" it is  "My Fit Image.jsx" I could hane named it "Fit Image.jsx" file I install my scripts in my Photoshop scripts tree and link Photoshop Presets\Scripts\ to my tree.

Capture.jpg

JJMack

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advocate ,
Jul 01, 2016 Jul 01, 2016

Copy link to clipboard

Copied

LATEST

JJMack​ What is in the <javascriptresource> is the name, but also the name and kind of parameters used:

det.png

The params are saved into a Descriptor with an 'objectToDescriptor' (and retrieved with the inverse 'descriptorToObject') function, and stored within the recorded action; which in turn the Script receives when played by the action as app.playbackParameters.

But this we know. I've solved my own debugging problem moving line by line a 'throw new Error()' – in case you're curious, the issue was caused by a cleaning routine (run after the main one) which wasn't dealing with the case of the script being run by an Action.

No matter what was the contingent nature of the issue, my question holds: how do you debug in ESTK an action-recorded script that is played?

I'd say it's not possible at all, but others may prove me wrong.

Davide

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines