2 Replies Latest reply on Feb 14, 2009 9:45 AM by Tomasz Bujlow

    TextFrames and Stories - what am I doing wrong?

    Tomasz Bujlow Level 1
      Hi,

      I have got problem with TextFrames and Stories in InDesign. So, I am executing this script:

      var myFrame = app.selection[0];
      var myStory = myFrame.parentStory;
      myID = myStory.id;
      alert("Sel: " + myID);
      alert("Story id: " + myStory.textFrames.length);

      First of all I'm getting handle to selected textFrame, then I am getiing handle and ID of Story, which contain this textFrame. Everything here works fine and we get here proper Story ID. But, when I execute the last line, I always get length=0. Why? If I selected a textFrame, which is a part of the story (I got the parentStroy attibute), the "length" in the last line should be always at least 1. But this is 0. I cannot understand why.

      So, how can I get all textFrames which belong to the story? I could admit, that when I execute this line:

      myStory.exportFile(myFormat, myFile);

      the content of the textFrame is put to file (like expected)....