🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: adobe.scripting.indesign
Article #450

Need help to debug simple javascript in CS3

#450
From: Scott_Wood
Date: Fri, 20 Mar 2009 20:01
18 lines
2308 bytes
Here's what I'm trying to accomplish:
I have 25 separate InDesign documents that have been populated via EasyCatalog and a data extract. There is one part of the content I need to target, which is a bullet list. The way the easy catalog brings in the bullets is via a table, each list is in it's own table, each bullet on it's own row (with a bullet character preceding the text in the row). Problem being that the client wants the bullets formatted like this (Bullet1 | Bullet2 | Bullet3) Basically a single line of copy that wraps in a text box, not a bullet list.

I need to convert each table in the document into text, then take out the bullet character and separate each row with the "|" character.

Here's the script that I finally got to run without errors, but now it just runs and runs and runs and doesn't do anything. It locks up indesign if I run it through the scripts panel, but running it through ExtentScript, I can stop it and continue using ID.
--------------------------------------------------------------------------

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( ",", "|"); }

--------------------------------------------------------------------------

I'm not very savvy with scripting, I've worked on this for many hours trying to figure it out. I'm hoping someone can just look at this and be like "you dumb@$$, just change xy & z and it'll work".

So anyone that'll consider looking at this, and see what I'm doing wrong, the help will be much appreciated. And you'd totally be free to heckle me for not being able to figure it out! :)
Technical Details
Message-ID: <59b85ced.-1@webcrossing.la2eafNXanI>
Path: arc1-ca.pugleaf.net!g2news2.google.com!news2.google.com!news.glorb.com!news2.glorb.com!newshub.sdsu.edu!webcrossing

Show Full Headers
Complete Article Headers
X-Google-Thread: f939a,ec8d471341cee86,start
X-Google-Attributes: gidf939a,domainid0,public,usenet
X-Google-Language: ENGLISH,ASCII-7-bit
From: Scott_Wood@adobeforums.com
Path: arc1-ca.pugleaf.net!g2news2.google.com!news2.google.com!news.glorb.com!news2.glorb.com!newshub.sdsu.edu!webcrossing
Newsgroups: adobe.scripting.indesign
Subject: Need help to debug simple javascript in CS3
Message-ID: <59b85ced.-1@webcrossing.la2eafNXanI>
Date: Fri, 20 Mar 2009 13:01:46 -0700
Lines: 36
MIME-Version: 1.0
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit