Thread View: adobe.scripting.indesign
1 messages
1 total messages
Started by asci
Tue, 10 Mar 2009 11:36
CS3 Get ObjectType of pageItem
Author: asci
Date: Tue, 10 Mar 2009 11:36
Date: Tue, 10 Mar 2009 11:36
22 lines
1271 bytes
1271 bytes
Hello,
When getting pageitems from a page i have some problems to get their type (e.g. Group, TextFrame). I have found a solution but i do not know if i can get some trouble with using getElements():
var curDoc = app.activeDocument;
var curPage = curDoc.pages[0];
var pageItems = curPage.pageItems;
for(var i=0; i<pageItems.length; i++) {
var curBox = pageItems[i];
var element = curBox.getElements();
if(element.length > 0) {
var groupItems = element[0];
alert(groupItems.constructor.name);
}
}
Is there any better solution to get the type of a pageItem? In my case <element> has only one element and i do not know if there is a case where there could be more elements in the array.
Thank you, asci
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads