Script to automate every other row
I am doing a large pricing catalog. I am linking my customer's Excel files to my InDesign CS4 tables. Every part of the table is formatted with cell styles. The first row has a .25 pt. rule below and the 2nd row has a 1 pt rule and it continues like this throughout the entire table. Some of the text is flush left, some center. I'd like to highlight an entire column, then run a script so this is automated. Is it even possible?
I've attached a small example of one of my tables in case I haven't explained this well.
Thank you
It's certainly possible.
I am a bit confused why you want to do this column-by-column, since your example appears to have uniform rows.
var i, r=app.selection[0].cells;
for (i=1; i<r.length; i+=2) {
r[i].cells.everyItem().appliedCellStyle="Cell Style 3";
That was originally written with the "cells" in the first line as "rows" (hence the variable r). But this loops over all the cells in the selection [a column], and applies a cell style (Cell Style 3) for each one that is odd-numbered (where the first cell is zero and thus even). You could modify individual attributes instead of using a style, but that seems inadvisible.
You do have to watch out for the fact that the upper rule of one cell is the lower rule of another, so the order of applied cell styles can matter in terms of which rule is visible.
If you want it to operate on entire rows of the selected table, swap out "cells" for "rows" in the first line.
Hope that's useful. If not, please be more specific in what you would like the script to do.
Similar Messages
-
How can I automatically delete every other row in a Numbers spreadsheet?
Thanks a lot.
It's what we spell "Un rang sur deux".
Automatic translator just replaced Engish words by French ones returning :
Chaque autre rangée
or
toutes les autres lignes
which had really no link with even/odd.
It's a nice day, not only the sun shine but I learnt something new
Yvan KOENIG (VALLAURIS, France) mardi 9 août 2011 16:42:55
iMac 21”5, i7, 2.8 GHz, 4 Gbytes, 1 Tbytes, mac OS X 10.6.8 and 10.7.0
My iDisk is : <http://public.me.com/koenigyvan>
Please : Search for questions similar to your own before submitting them to the community
To be the AW6 successor, iWork MUST integrate a TRUE DB, not a list organizer ! -
Every other row (background color)
I want to keep it simple and in css. How can I get this to work properly so every other row has a yellowish background color with no gaps between the words.
This is what I have but its producing an odd result.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<style type="text/css">
margin: 0px;
padding: 0px;
div#footer{
height:auto;
background-color:green;
clear:both;
font-size:14px;
width:800px;
div#footer ul{
margin:0;
padding:0;
list-style:none;
div#footer li{
width:155px;
display:inline-block;
text-align:center;
vertical-align: top;
/* horizontal line breaks */
hr {
border: 0;
color: #323232;
background-color: #323232;
height: 1px;
width: 95%;
text-align: center;
.even {
background-color: #FF9;
</style>
</head>
<body>
<div id="footer">
<ul>
<li class="even">01/15/2011</li>
<li class="even">Broadway Brewhouse</li>
<li class="even">New Phila, OH</li>
<li class="even">10pm</li>
<li class="even">330-343-9231</li>
<hr />
<li>06/11/2011</li> <li>Edelwiess Inn</li> <li>Sugarcreek, OH</li> <li>10pm</li> <li>330-852-3750</li>
<hr />
<li class="even">04/09/2011</li>
<li class="even">Uhrichsville Moose Lodge (Open to the Public)</li>
<li class="even">Uhrichsville, OH</li>
<li class="even">TBD</li>
<li class="even">740-922-9098</li>
<hr />
<li>01/15/2011</li> <li>Broadway Brewhouse</li> <li>New Phila, OH</li> <li>10pm</li> <li>330-343-9231</li>
</ul>
</div>
</body>
</html>To create coloured backgrounds to every other row use this.
#averages tr:nth-of-type(odd) {
background-color:#ccc;
Substitute the id of your table for mine and change the colour code to suit. -
Does anyone knows how to highlight every other row in numbers mac
Does anyone knows how to highlight every other row in numbers and are there any good tutorials out there???
Hi Lee,
Select a non-header cell in the table.
Open the Inspector and choose the Table Inspector.
Click to check the 'Alternating Row Color' box in the Cell Background section.
Click the Color well beside the check box to open the Color pane.
Choose a colour.
The alternating colours are applied only to the non-header rows and non-header columns in your table.
Regards,
Barry -
Html query report /every other row grey
Hello
i have this query to html report
do you know how to make every other row grey in the out pu of
the query.
and where do i put it in this code below?
thanks in advance
<cfquery name="GetCompanies"
datasource="#Request.MainDSN#">
SELECT
CompanyID,
CompanyName,
Address,
City,
State,
ZipCode,
Comments
FROM
Company
ORDER BY
CompanyName ASC
</cfquery>
<html>
<head>
<title>ColdFusion MX Bible</title>
<link rel="stylesheet" href="styles.css">
</head>
<body>
<h1>Company List</h1>
<TABLE width=100% align="left" border="4" rules="all">
<tr>
<td><b>ID</b></td>
<td><b>Name</b></td>
<td><b>Address</b></td>
<td><b>City</b></td>
<td><b>State</b></td>
<td><b>ZIP Code</b></td>
<td> </td>
</tr>
<cfoutput query="GetCompanies">
<tr>
<td>#CompanyID#</td>
<td>#CompanyName#</td>
<td>#Address#</td>
<td>#City#</td>
<td>#State#</td>
<td>#ZipCode#</td>
<td>
<a
href="EmployeeList.cfm?CompanyID=#CompanyID#">Employees</a>
<a href="CompanyAddForm.cfm">Add</a>
<a
href="CompanyEditForm.cfm?CompanyID=#CompanyID#">Edit</a>
<a
href="CompanyDeleteForm.cfm?CompanyID=#CompanyID#">Delete</a>
</td>
</tr>
</cfoutput>
</TABLE>
</body>
</html>The fastest, but crudest and ugliest.
<cfoutput query="GetCompanies">
<tr #IIF(GetCompanies.CurrentRow MOD
2,DE(''),DE('backgroundColor="##999"'))#>
kellyhondalovesmusic wrote:
> Hello
> i have this query to html report
> do you know how to make every other row grey in the out
pu of the query.
> ??
>
>
> and where do i put it in this code below?
>
>
>
> thanks in advance
>
>
>
> <cfquery name="GetCompanies"
> datasource="#Request.MainDSN#">
> SELECT
> CompanyID,
> CompanyName,
> Address,
> City,
> State,
> ZipCode,
> Comments
> FROM
> Company
> ORDER BY
> CompanyName ASC
> </cfquery>
>
> <html>
> <head>
> <title>ColdFusion MX Bible</title>
> <link rel="stylesheet" href="styles.css">
> </head>
>
> <body>
>
> <h1>Company List</h1>
>
> <TABLE width=100% align="left" border="4"
rules="all">
> <tr>
>
> <td>
ID</td>
> <td>
Name</td>
> <td>
Address</td>
> <td>
City</td>
> <td>
State</td>
> <td>
ZIP Code</td>
> <td> </td>
> </tr>
> <cfoutput query="GetCompanies">
> <tr>
>
> <td>#CompanyID#</td>
> <td>#CompanyName#</td>
> <td>#Address#</td>
> <td>#City#</td>
> <td>#State#</td>
> <td>#ZipCode#</td>
> <td>
> <a
href="EmployeeList.cfm?CompanyID=#CompanyID#">Employees</a>
> <a href="CompanyAddForm.cfm">Add</a>
> <a
href="CompanyEditForm.cfm?CompanyID=#CompanyID#">Edit</a>
> <a
href="CompanyDeleteForm.cfm?CompanyID=#CompanyID#">Delete</a>
> </td>
> </tr>
> </cfoutput>
> </TABLE>
>
> </body>
> </html>
>
> -
Query output skipping every other row
I am using Coldfusion MX 7.0.1, and have two applications
using the same datasource. In one, a SELECT query followed by a
cfoutput lists all rows properly, but the following code (in the
other app) only lists every other row of the query result set, for
some reason:
<cfselect name="Record_Group" multiple="no" size="4"
required="yes" message="Select a Record Group...">
<cfoutput query="RecordGroupQ">
<cfif
compare(#RecordGroupQ.RecordNum#,#Edit_origQ.acc_num#) eq 0>
<option value="#RecordGroupQ.RecordNum#"
selected>#RecordGroupQ.RecordNum#</option>
<cfelse>
<option
value="#RecordGroupQ.RecordNum#">#RecordGroupQ.RecordNum#</option>
</cfif>
</cfoutput>
</cfselect>
The query is in the <head>, and is:
<cfquery name="RecordGroupQ" datasource="arch_card">
SELECT RecordNum FROM RecordGroups ORDER BY RecordNum ASC;
</cfquery>
Has anyone seen anything like this before?
Thanks,
JasonDan Bracuk wrote:
> As an aside, you don't want semi-colons in cfqueries.
that's interesting... why is that so? i have been wondering
about
semi-colons lately myself, but could not find a definite
explanation/rule/guide/best practice on whether to use them
or not...
could you please explain, Dan?
Azadi Saryev
Sabai-dee.com
http://www.sabai-dee.com -
Hello all. I am once again stumped and would very much appreciate any help.
I have a folder with many text files such as this...
A 2013-03-31.txt
A 2013-06-30.txt
A 2013-09-30.txt
A 2013-12-31.txt
A 2014-03-31.txt
A 2014-06-30.txt
A 2014-09-30.txt
B 2013-03-31.txt
B 2013-06-30.txt
B 2013-09-30.txt
B 2013-12-31.txt
B 2014-03-31.txt
B 2014-06-30.txt
B 2014-09-30.txt
…and so on…
and I'm loading all of the files beginning with A to an existing table in SQL Server. I'm loading the data as is to a staging table, no data type conversions, and I add only two derived columns. I have a loop to accomplish this, and it's working perfectly
except for one detail. All of the files in 2013 load every other row. All of the 2014 files load all rows as intended.
Any idea what would cause this? All files are being loaded using the same loop, same variables, same everything. My enumerator on the for each loop is Foreach File. The DataRowsToSkip property on the flat file connection manager is 0. I'm not sure where
to look next. I need all rows in all files to be loaded.
Forgot to mention that there is a difference between the 2013 and 2014 files. The 2014 files have 8 additional columns. I suspect this is causing my issue, just not sure what to do about it.
Thanks for any help you can provide!
WeeLassIn SSIS 2012 and above these additional columns would not cause a failure, but looks like lead to you having impartial loads.
I suggest you create two loops, one for one metadata - files from 2014 and another for 2013 ones.
Arthur
MyBlog
Twitter -
How to make the shade for every other row?
Hi,
i want the rows in my report dispalyed as:
row1: gray
row2: white
row3: gray
row4: white
row5: gray
thanxHello,
Highlight every alternate row
Highlight every alternate row
Regards -
I want to do this for Dragging and Dropping multiple rows purposes. After the user selects multiple rows they expect to be able to click on one of those rows to start a drag and drop for all of them. Now, I have to tell them when they select the last
row, they need to keep the mouse button down and then start the drag which nobody is used to.
Thanks,
Jim WelchI want to do this for Dragging and Dropping multiple rows purposes. After the user selects multiple rows they expect to be able to click on one of those rows to start a drag and drop for all of them. Now, I have to tell them when they select the last
row, they need to keep the mouse button down and then start the drag which nobody is used to.
Thanks,
Jim Welch
Hello Jim,
The way you suggested the user is common way to select and drag, where will these selected rows dragged to?
If possible, you could consider adding a button to move these rows to target control instead of letting user drag and drop manually.
Regards,
Carl
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click
HERE to participate the survey. -
Script to insert new master on every other page
I've got an indesign document with 131 pages (front side of postcards). I need to add the back side of the postcard (Master) to every other page. I don't want to manually do this due to the time and that I will need to do this again and again. Does anyone have a script that will allow for an insertion of even blank pages on the even number pages and then I can apply the master page to all blank pages? Anything will help. Thank you!!
Just found that the script on this forum http://forums.adobe.com/message/3223771#3223771#3223771 does it perfectly.
-
How can I sum every other column in the same row?
I have, for each employee, two columns: Planned and Worked.
I would like to sum the values in each Planned column. There are 25 employees, each with their own Planned and Worked columns, on the same row.
How can I do a SUM of every other column, starting with Planned?
Thank you.Thank you, Yellowbox!
The exact formula didn't work; however, it gave me a precise path to follow and come up with this: =SUMIF(E2:BB2,"=Planned",E3:BB3)
Week
Ending Date
Planned Subtotal
Worked Subtotal
Employee1
Employee2
Employee3
Planned
Worked
Planned
Worked
Planned
Worked
1
01/04/2014
120
40
38
40
44
40
50
2
01/11/2014
If not for your starting point, I'd have wasted many more hours on this.
Thanks again!
BB -
Query results:every other record/row grey and white
Hello guys,
query results:every other record/row grey and white
how would you make every other record/rows a different color
just like the forums color. Lightest grey and white?
<cfquery name="Myqueryname"
datasource="#Request.MainDSN#">
SELECT
CompanyID,
CompanyName,
Address,
City,
State,
ZipCode,
Comments
FROM
Company
ORDER BY
CompanyName ASC
</cfquery>
<html>
<head>
<title>CF TUTORIALS</title>
<link rel="stylesheet" href="styles.css">
</head>
<body>
<h1>All CO Listings</h1>
<table>
<tr>
<td><b>ID</b></td>
<td><b>Name</b></td>
<td><b>Address</b></td>
<td><b>City</b></td>
<td><b>State</b></td>
<td><b>ZIP Code</b></td>
<td> </td>
</tr>
<cfoutput query="Myqueryname">
<tr>
<td>#CompanyID#</td>
<td>#CompanyName#</td>
<td>#Address#</td>
<td>#City#</td>
<td>#State#</td>
<td>#ZipCode#</td>
<td>
<a href=" ALL Emps.cfm?CompanyID=#CompanyID#">ALL
Emps</a>
<a href=" AddCO Form.cfm">AddCO</a>
<a href="
Editco.cfm?CompanyID=#CompanyID#">Editco</a>
<a
href="CoDeleteForm.cfm?CompanyID=#CompanyID#">Delete</a>
</td>
</tr>
</cfoutput>
</table>
</body>
</html>There is a cool tool in Coldfusion called MOD
This basically calculates the remainder of the row number
when divided.
I interpreted its use to something like this, which has
worked for me.
<cfoutput query="qry_requestedlist" maxrows="30"
startrow="1">
<cfset EvenRow=#CurrentRow# +1>
<cfif CurrentRow Mod 2 IS 1>
<tr>
<th class="grey" CurrentRow#</th>
<cfelse>
<th class="white">#CurrentRow#</th>
<tr>
</cfif>
</cfoutput>
I doubt this is precisely what you want but this is the sort
of thing. -
new airport: can't get my macbook or my imac to join my wireless automatically, my other stuff still joins without problems but i have to join manually with the book and the imac ?? I've tried all the settings and every thing else I can think of.....
Running on Lion, never had a problem before until the old airport died and I replaced it.try connecting the device in _*recovery mode*_, then restore from your backup.
also, make sure [_*Apple Mobile Device Service*_|http://support.apple.com/kb/TS1567] is installed and started.
JGG -
Adding every other field of two separate rows together.
Hi,
We're using Oracle 11.1.
I's like to add two rows from two different queries together,
I'd like it to look something like:
with
a as
( select 'a' q,'b' r,'c' s,'d' t,'e' u from dual),
b as
( select '1' q, '2' r,'3' s,'4' t,'5' u from dual)
select a.q, b.r, a.s, b.t, a.u from a, b;The trouble is I'm already using WITH and both the 'real queries' get their data from the progressive WITH statements already up top.
I'd like to add every other field from each query to a result row.
I have to use only SQL.
Is there a way I can use UNION and combine the rows using dummy fields for the fields I don't want to use?
Some something like
I know this isn't right but...it sort of what I want to do.
select * from
( select 'a' q,' ' r,'c' s,' ' t,'e' u from dual
union
select '1' q, '2' r,' ' s,'4' t,' ' u from dual);Anybody?Can u try using join.
select a.q, b.r, a.s, b.t, a.u from
(select 'a' q,'b' r,'c' s,'d' t,'e' u from dual) as a,
( select '1' q, '2' r,'3' s,'4' t,'5' u from dual) as b;
This will result in a Cartesian join, but if you have a common column between a & b, then you can use it in the where clause. -
I've ditched the AppleTV in favour of a second Mac Mini. Much better. I'm streaming HDTV bitstreams and DVD (MPEG) bitsreams from a USB drive attached to Airport Extreme. (Simple alias creation in the MOVIE folder and additional components installed for Quicktime). No loss of quality through converting to h.264. No waiting around 24 hours to encode. Front Row interface is MUCH better than AppleTV interface.
Two questions which I can't find the answer to: First, is there a way to automatically start front row? I would like the Mac Mini to automatically turn on (easy) and then automatically start the Front Row interface.
Second, is there a way to modify the Front Row menu structure?
All I would like is simply Videos: Movies. I would like ro remove (or hide) Sharing... Trailers... etc.
Any help would be appreciated.
Many thanks.You can write an AppleScript, that you add to your user's login items, that will open Front Row each time you login. You can find the instructions here to write the script:
http://discussions.apple.com/thread.jspa?messageID=2148108
I don't think there's anyway to change the built-in menu structure, though. It's hard-coded into Front Row. You can add folders and sub-folders to your user's Movies folder. Front Row will follow them down into all your video files.
-Doug
Maybe you are looking for
-
How to make a new folder in my in box
I use to have separate folder in my inbox on Mac Pro and now I try to find the way to do the same thing on iPad air , who's know if I can do that ?
-
How to deal with Flash 256 levels of recursion limitation !!
Hi, I am working on an dynamic flash component. I got data from xml and based on that data i am creating movieClip. Now i want to place the movieclip on unique place, for that i had implemented some logic using currently created movieclip hitTest wit
-
Lumia 710 can't open E-mails...
I am trying to send the Pages & Numbers files saved on my iPhone to my Lumia 710, i have the option to send it by Pages & Numbers or Word & Excel, whenever i try to send either by e-mail to my Windows Phone, it downloads the file but it says "Can't O
-
Problem in Fileupload utility ora-06508
Dear all , i downloaded the demo of oracle file upload utility and i applied all the steps of insalling it but when i run it , it gives me the following error ( ora-06508) can any one help me in solving this problem
-
Will Print on White -Error with Colored Paper: too Small
Trying to print gift tags on colored paper with Photosmart 7960. Print Preview indicates will fit and prints ok on white paper. Using colored paper of same weight and thicker - printer error "paper too small" This question was solved. View Solution