🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: adobe.scripting.indesign
Article #1293

TextFrames and Stories - what am I doing wrong?

#1293
From: Tomasz_Bujlow
Date: Sat, 14 Feb 2009 16:43
17 lines
1474 bytes
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)....
Technical Details
Message-ID: <59b7ed12.-1@webcrossing.la2eafNXanI>
Path: arc1-ca.pugleaf.net!g2news2.google.com!news2.google.com!newshub.sdsu.edu!webcrossing

Show Full Headers
Complete Article Headers
X-Google-Thread: f939a,e03a19f50cae18e3,start
X-Google-Attributes: gidf939a,domainid0,public,usenet
X-Google-Language: ENGLISH,ASCII-7-bit
From: Tomasz_Bujlow@adobeforums.com
Path: arc1-ca.pugleaf.net!g2news2.google.com!news2.google.com!newshub.sdsu.edu!webcrossing
Newsgroups: adobe.scripting.indesign
Subject: TextFrames and Stories - what am I doing wrong?
Message-ID: <59b7ed12.-1@webcrossing.la2eafNXanI>
Date: Sat, 14 Feb 2009 08:43:45 -0800
Lines: 25
MIME-Version: 1.0
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit