Reply To: Table script for setting var column widths

#84885

It says something like:

Error: 8
Syntax Error

Engine: main
File (etc)
Line:18
Source: alert(“Table width updated sucessfully…”);
Responsible text: ”

Ooh, I just fixed this one with Extendscript Toolkit (I found the debug function there). There where typographic quotes instead of dumb ones.

But now it still stops at:
with (myDoc.viewPreferences){

Anyway, I found out this script will change all the colums in the document and that’s not what I was looking for.

This was what I needed:

var myDoc = app.activeDocument;
var myWidths = [100, 100, 150, 150];
for(var j=0; j < myWidths.length; j++)
{
app.selection[0].columns[j].width = myWidths[j];
}

So simple, so efficient;) After all, it was good to dive into the world of table scripting and all the possibilities there are. Ari, thanks for your time and response.

This article was last modified on May 13, 2016

Comments (0)

Loading comments...