Skip to main content
Participant
September 9, 2021
Question

Bug in VSCode ExtendScript Debugger: it stops working when a particular string is in the code

  • September 9, 2021
  • 1 reply
  • 244 views

For me, the following script does not run in VSC ExtentScript Debugger:

// '<![CDATA[' + str + ']]>'
alert('hello world');

I have to remove the first line – yes, the comment – in order to run it.

Tried and reproduces in Photoshop 2021 and InDesign 2020.

(VSC 1.57.1, ExtendScript Debugger 1.1.2, InDesign 15.1.3.302, Photoshop 22.1.1, on macOS 10.14.6/Intel)

 

I wouldn't have stumbled upon this error, if InDesign's ES API would handle XMP correctly. When I exported a document with some XMP strings that my script had written, in the IDML there were no CDATA markings around my string, which might break the XML with some string content. So I wrote functions to wrap that myself.

    This topic has been closed for replies.

    1 reply

    K.Daube
    Community Expert
    Community Expert
    October 25, 2021

    Well, in ESTK (engine = ESTK CC) I also get nothing, but an error "Cannot execute".

    Trying to find the culprit I end up with this

    main ();
    
    function main () {
    var a = "<![",
    b = "CDATA[",
    c = "]]>",
    str = "xxx";
    a = a + b + str + c ;
    alert('hello world');
    $.writeln ("Hello");
    }

    Running this reports "no erros", but the script does not stop at the end and I do not get any output. Stopping the script creates the message "Can not execute" and after a while «Execution halted. Engine did not respond» (Engine may be ExtendScript Toolkit CC or any of my FrameMakers.

    After replacing ]]> for the variable c by ]> or ]] the script runs...

    This lets me assume that the problem is not in the debugger, but in the ExtendScript engine itself.