🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: adobe.scripting.indesign
Article #10133

Iterate thru selected rows of a table

#10133
From: Martin Fischer*
Date: Thu, 06 Jul 2006 13:32
29 lines
1409 bytes
I would like to iterate thru some selected rows of a table to set their filcolors like this:

 
var mySel = app.selection[0].rows 
var myCols = ["Green", "Green", "Blue", "Red"]; 
var myCounter = 0

for (oneRow = 0; oneRow < mySel.length; oneRow++) 
{ 
	mySel[oneRow].fillColor = app.documents[0].swatches.item(myCols[myCounter]); 
	if (myCounter < myCols.length-1) 
	{ 
		myCounter++ 
	} 
	else 
	{ 
		myCounter = 0 
	} 
} 




But this script does not apply the fillColor from the first row of selected rows upwards to the last row of the selected rows, but from the first row of the parent table to the count of selected rows.

How can I adress the first row of the selected rows?

Thanks
Martin
Technical Details
Message-ID: <3bc0d3f4.-1@webcrossing.la2eafNXanI>
Path: arc1-ca.pugleaf.net!g2news2.google.com!news3.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!nx01.iad01.newshosting.com!newshosting.com!193.190.198.17.MISMATCH!syros.belnet.be!news.belnet.be!news.stben.net!webcrossing

Show Full Headers
Complete Article Headers
X-Google-Thread: f939a,5a6e15a0faa4778e,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: Iterate thru selected rows of a table
Message-ID: <3bc0d3f4.-1@webcrossing.la2eafNXanI>
Date: Thu, 6 Jul 2006 06:32:24 -0700
Lines: 30
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!border1.nntp.dca.giganews.com!nntp.giganews.com!nx01.iad01.newshosting.com!newshosting.com!193.190.198.17.MISMATCH!syros.belnet.be!news.belnet.be!news.stben.net!webcrossing