Article View: adobe.scripting.indesign
Article #14983[js] Problem with Objects
From: Mike_Oldham
Date: Thu, 08 Jan 2004 00:34
Date: Thu, 08 Jan 2004 00:34
29 lines
2031 bytes
2031 bytes
I'm having a problem w/ objects. I wonder if I'm just doing something wrong, or if ID just works this way w/ javascript, and I'll just have to find a way to deal with it.
I assign 2 variables to textFrame objects.
formatLABEL = GUIDocument.textFrames[0];
storyLABEL = GUIDocument.textFrames[1];
Then I later Create more objects on the page. Each new object goes to the front of the textFrames array (Meaning if add a textFrame to the document, it becomes GUIDocument.textFrames[0]).
var DDMax = impStory.length;
for (var i = 0; i < DDMax-1; i++){
thisFrame = GUIDocument.textFrames.add();
var daBounds = new Array(3);
daBounds[0] = storyLabelBounds[0] + ((i+1)*(storyLabelBounds[2] - storyLabelBounds[0]));
daBounds[1] = storyLabelBounds[1];
daBounds[2] = daBounds[0] + (storyLabelBounds[2] - storyLabelBounds[0]);
daBounds[3] = storyLabelBounds[3];
thisFrame.contents = impStory[i].sHeadline
thisFrame.geometricBounds = daBounds
}
When i do the Same process in VB, formatLABEL and storyLABEL are assigned to the original objects. But in JS they seem to be assigned to the array location(GUIDocument.textFrames[0] and GUIDocument.textFrames[1] respectively) not the actual object.
So if i try to find info on formatLABEL, it gives me info on the latest object Added, instead of the original object.
Any comments would be great
Mike Oldham
Technical Details
Message-ID:
<2ccf3f6e.-1@webx.la2eafNXanI>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!fu-berlin.de!newsfeed01.sul.t-online.de!t-online.de!webxShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f939a,271beb45701319e6,start X-Google-Attributes: gidf939a,public X-Google-ArrivalTime: 2004-01-07 16:37:46 PST From: Mike_Oldham@adobeforums.com Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!fu-berlin.de!newsfeed01.sul.t-online.de!t-online.de!webx Newsgroups: adobe.scripting.indesign Subject: [js] Problem with Objects Message-ID: <2ccf3f6e.-1@webx.la2eafNXanI> Date: Wed, 7 Jan 2004 16:34:03 -0800 Lines: 39 MIME-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 8bit