Skip to main content
Andreas Jansson
Inspiring
January 19, 2011
Answered

[JS, CS5] Strange output in javascript console, from extractLabel

  • January 19, 2011
  • 1 reply
  • 2102 views

I get a lot of empty CData in the javascript console, if I write out the result from extractLable('anynonexistinglabel').

I use this code:

var allPgItems = app.activeDocument.allPageItems;
for (var i = 0; i <=allPgItems.length-1; i++){
   
    var currentItem = allPgItems;
    $.writeln(currentItem.extractLabel('asdfgh'))
   
}

The result:

<![CDATA[
]]><![CDATA[
]]><![CDATA[
]]><![CDATA[
]]><![CDATA[
]]><![CDATA[
]]><![CDATA[
]]><![CDATA[
]]><![CDATA[
]]> etc

Is this behaviour repeatable?

This topic has been closed for replies.
Correct answer Peter Kahrel

It's a bug in the ESTK, on Windows, anyway. The ESTK doesn't like empty or null strings. See what happens when you do $.writeln ("")

Peter

1 reply

Peter Kahrel
Community Expert
Peter KahrelCommunity ExpertCorrect answer
Community Expert
January 22, 2011

It's a bug in the ESTK, on Windows, anyway. The ESTK doesn't like empty or null strings. See what happens when you do $.writeln ("")

Peter

Andreas Jansson
Inspiring
January 24, 2011

Yes, it's the same:

<![CDATA[
]]>

Thanks. It doesn't bother me too much. Just good to know it's the same for everyone else, and that this is not specific to my environment.

Best regards,

Andreas

Community Expert
June 1, 2011

Andreas,

met the same bug during developing a script with ESTK v 3.5.1.59 (CS5) using insertLabel() and extractLabel().
After restarting both ESTK and InDesign CS5 (7.0.4), everything was o.k. again.

Empty text frames and empty cells showed:

<![CDATA[
]]>

as selection's contents.

An if(myCell.contents == "") let ESTK loop endlessly.

Glad it's over. At least for a while ;-)

Uwe

P.S. I'm on Mac OS X 10.5.8

Message was edited by: Uwe Laubender