🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: adobe.scripting.indesign
Article #9269

Styling tables with table styles and cell styles

#9269
From: Martin Fischer*
Date: Thu, 24 Aug 2006 05:07
60 lines
2795 bytes
Hoping for more user friendly flexibility and durability for styling tables and cells I purchased the plugin TableStyles & CellStyles 1.1 of a company whose employee may drink tea.

Now I have got some problems scripting with this plugin and the support doesn't answer for about 24 h. - Maybe the employees are drinking tea yet. ;-)
So I will try to set my questions here.

1. Troubles removing styles by script
Removing every table style works:

app.documents[0].tableStyles.everyItem().remove()



But trying to remove cell styles with "app.documents[0].cellStyles.everyItem().remove()" results an error: could not get style to delete. Even trying to delete cell styles in a loop results the same error:



 
var myDoc=app.documents[0]; 
for (oneStyle = myDoc.cellStyles.length-1; oneStyle >= 0; oneStyle--) { 
	myDoc.cellStyles[oneStyle].remove() 
} 


Is this a known error?
How can I remove every cell style of a document by script?

2. Importing styles from another document by script
Trying to import table styles and cell styles from another document like below causes errors:



 
app.documents[0].importTableStyles(myFile); 
app.documents[0].importCellStyles(myFile); 




-> Parameter "replaceOption" needed for event "importTableStyles".
-> Parameter "replaceOption" needed for event "importCellStyles".

Trying to do this:

 
app.documents[0].importTableStyles(myFile, true); 
app.documents[0].importCellStyles(myFile, true); 


causes the following errors:
-> Error: Invalid value for parameter "replaceOption" of event "importTableStyles". Expected ReplaceOption enumerator, but got TRUE.

In the JavaScript Scripting Guide of T&CS I couldn't find instructions for use parameter "ReplaceOption".
There is only the "From"-Parameter documented.

3. Missing files for the demo script "DemoTableCellSyles.jsx".
Now I wanted to run the demo script "DemoTableCellSyles.jsx".
But therefore I am missing the DemoFiles "TableStylesTemplate.indd" and "foo.indd", which the script requires. Even in the current download package these files are missing. Does anybody know where to get them?

Thanks for paying attention to my extensive explanation.
Martin
Technical Details
Message-ID: <3bc16072.-1@webcrossing.la2eafNXanI>
Path: arc1-ca.pugleaf.net!g2news2.google.com!news3.google.com!news2.volia.net!news.ecp.fr!news.stben.net!webcrossing

Show Full Headers
Complete Article Headers
X-Google-Thread: f939a,5d475286f78b342a,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: Styling tables with table styles and cell styles
Message-ID: <3bc16072.-1@webcrossing.la2eafNXanI>
Date: Wed, 23 Aug 2006 22:07:20 -0700
Lines: 107
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!news2.volia.net!news.ecp.fr!news.stben.net!webcrossing