Article View: adobe.scripting.indesign
Article #8286Move textframes of a defined layer
From: Martin Fischer*
Date: Mon, 23 Oct 2006 13:51
Date: Mon, 23 Oct 2006 13:51
22 lines
1216 bytes
1216 bytes
It seems to be so simple.
But it's driving me crazy!
I would like to move every object of one layer relative to it's xy-position.
The following script makes InDesign CS2 crash (mostly if there are textframes to be moved):
var myDoc = app.documents[0];
var myLayer = myDoc.layers[0];
var myObjects = myDoc.pageItems;
for (k = 0; k < myObjects.length; k++) {
if (myObjects[k].itemLayer == myLayer)
myObjects[k].move(undefined,[0, 10]);
}
After commenting out the condition (if (myObjects[k].itemLayer == myLayer)) the Script works very well. But I don't see what's wrong in the condition, do you?
Thanks
Martin
Technical Details
Message-ID:
<3bc20d2b.-1@webcrossing.la2eafNXanI>Path:
arc1-ca.pugleaf.net!g2news2.google.com!news3.google.com!news.glorb.com!news.isoc.lu!news.stben.net!webcrossingShow Full Headers
Complete Article Headers
X-Google-Thread: f939a,6b219b18d551db99,start X-Google-Attributes: gidf939a,public X-Google-Language: ENGLISH,ASCII-7-bit From: "Martin Fischer*" <martin.fischer@online.de> Newsgroups: adobe.scripting.indesign Subject: Move textframes of a defined layer Message-ID: <3bc20d2b.-1@webcrossing.la2eafNXanI> Date: Mon, 23 Oct 2006 06:51:20 -0700 Lines: 23 MIME-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 8bit Path: arc1-ca.pugleaf.net!g2news2.google.com!news3.google.com!news.glorb.com!news.isoc.lu!news.stben.net!webcrossing