Thread View: adobe.scripting.indesign
6 messages
6 total messages
Started by Scott_Wood
Wed, 25 Feb 2009 17:13
Merging table rows, separating each row with a " | " character
Author: Scott_Wood
Date: Wed, 25 Feb 2009 17:13
Date: Wed, 25 Feb 2009 17:13
7 lines
1586 bytes
1586 bytes
I'm hoping someone can help me out with this! I have very basic scripting experience and I've been beating my head against my keyboard trying to figure this out. I'm working on a catalog for a company where all the data for the products in coming into InDesign using Easy Catalog. My problem is that the company entered the data(and lots of it!) into the database slightly wrong. In order to import the data, I have to use a table with 1 column to import the data, then easy catalog adds a table row for each line of info. Each page would have approximately 8 tables, each with a variable number of table rows. The data is basically a bullet list, but they don't want it displayed as such. Instead it would be like this "item1 | item2 | item3 | item4". So I'm trying to figure out how to create a script that runs through and entire document, merges every table into a single line text, separating the data in each row with the " | " character. I'm using CS3. Much thanks to anyone that can help!
Re: Merging table rows, separating each row with a " | " character
Author: Robert Tkaczyk
Date: Wed, 25 Feb 2009 17:32
Date: Wed, 25 Feb 2009 17:32
8 lines
1296 bytes
1296 bytes
what platform - PC or MAC - and which language do you prefer - JavaScript, VisualBasic, AppleScript ? you need to iterate all tables (from back) and insert " | " at beginning of each cell and then merge all cells, or you can convert table to text with " | " as both separators and then convert Paragraph back to table - if you need one-cell-table instead of multi-cell-tables robin -- www.adobescripts.com
Re: Merging table rows, separating each row with a " | " character
Author: Scott_Wood
Date: Wed, 25 Feb 2009 17:59
Date: Wed, 25 Feb 2009 17:59
4 lines
972 bytes
972 bytes
Hi Rick, Thanks for the reply! The platform is PC, JavaScript would be preferable. As for the tables, I don't actually need them at all, all I need is convert the table to text. So I just have a normal text frame with no tables in it. Much much appreciation for your help!
Re: Merging table rows, separating each row with a " | " character
Author: Scott_Wood
Date: Wed, 25 Feb 2009 18:06
Date: Wed, 25 Feb 2009 18:06
1 lines
680 bytes
680 bytes
Robin! Sorry, not Rick!
Re: Merging table rows, separating each row with a " | " character
Author: Kasyan_Servetsky
Date: Fri, 27 Feb 2009 07:50
Date: Fri, 27 Feb 2009 07:50
10 lines
901 bytes
901 bytes
var myDoc = app.activeDocument;
for (i = myDoc.stories.length - 1; i >= 0; i --) {
for (j = myDoc.stories[i].tables.length - 1; j >= 0; j --) {
var myTable = myDoc.stories[i].tables[j];
myTable.convertToText(",", "|");
}
}
Re: Merging table rows, separating each row with a " | " character
Author: Scott_Wood
Date: Mon, 02 Mar 2009 23:41
Date: Mon, 02 Mar 2009 23:41
1 lines
727 bytes
727 bytes
Thanks so much for your help, I'll let you know if this works on not!
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