I am trying to label all the threaded frame on a layer with same label, but I am not able to iterate on the textframes of the layer. Below is the snippet:
var myDoc=app.activeDocument; var myTotalPage = myDoc.pages.length;
if (app.selection.length != 1 || app.selection[0] != "[object TextFrame]" || app.selection[0].label != "sections") { alert("To run this script please select a textframe first, with label 'sections'."); } else {
var collect_all=new Array; //Get properties of textframe var myTextFrame = app.selection[0]; // var myTextFramePrev = myTextFrame.previousTextFrame; // var myTextFrameNext = myTextFrame.nextTextFrame;
// Get the name of layer on which "sections" frames are lying
var Layer_Name=myTextFrame.itemLayer.name; //alert("Name of the layer is "+Layer_Name);
//Count total nos of frames on layer var count_txFrmes_on_layer= myDoc.layers.item(Layer_Name).textFrames.length; //alert("Text Frame count on layer is "+count_txFrmes_on_layer);
for (var a=0; a<collect_all.length-1; a++) { if (collect_all[a].nextTextFrame == null) { check_next = a+1; while (check_next < collect_all.length && collect_all[check_next].previousTextFrame != null) check_next++; try{ collect_all[check_next].label="sections"; }catch(e){} if (check_next < collect_all.length) { collect_all[a].nextTextFrame = collect_all[check_next]; } } } }
Any suggestions please.
Thanks!
-- This list is a free service of LassoSoft: http://www.LassoSoft.com/ Search the list archives: http://www.ListSearch.com/InDesign/Browse/ Manage your subscription: http://www.ListSearch.com/InDesign/
Jun 04
Robert Tkaczyk Re: label all text frame on layer
Jun 04, 2010; 09:36
Robert Tkaczyk
Re: label all text frame on layer
Jun 06
pankaj.c Re: label all text frame on layer
Jun 06, 2010; 20:25
pankaj.c
Re: label all text frame on layer
Jun 06
pankaj.c Re: label all text frame on layer
Jun 06, 2010; 21:16
pankaj.c
Re: label all text frame on layer
Search
Lasso Programming
This site manages and broadcasts several email lists pertaining to Lasso Programming and technologies related and used by Lasso developers. Sign up today!