Article View: adobe.scripting.indesign
Article #14951JS: cannot add column in table
From: Peter_Kahrel
Date: Sun, 11 Jan 2004 13:33
Date: Sun, 11 Jan 2004 13:33
20 lines
1930 bytes
1930 bytes
I seem unable to add a column in a table before another column. What I've tried is this. With the cursor in a table, I first say
_table = app.selection[0].parent.parent;
to get a reference to the table object. If you then say
_table.columns.add()
a column is added after the last column. So far so good. To add a column before or after a specified column, .add() needs two parameters: a location (before or after) and a reference to the object before or after which the new column is to be inserted. I've tried the following lines, none of which work:
_table.columns.add( LocationOptions.before , _table.columns[3] )
_table.columns.add( LocationOptions.before , _table.cells[3] )
_table.columns.add( LocationOptions.before , _table.cells.item("3:0") )
_table.columns.add( LocationOptions.before , 3 )
I had expected the first one to work, since _table.columns[3] denotes an object of type Column, but the debugger reports "Invalid parameter". The second one looks improbable, but as the debugger reports that parameterless _table.columns.add() has added an object of type Cell, I tought, well, hell, let's give it a shot--but it doesn't work. The two others you wouldn't expect to work, and indeed they don't, but you never know and you have to try something.
Has anyone any suggestions?
Peter
Technical Details
Message-ID:
<2ccf4e4c.-1@webx.la2eafNXanI>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!eusc.inter.net!newsfeed01.sul.t-online.de!t-online.de!webxShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f939a,ec9093a5a0bc05db,start X-Google-Attributes: gidf939a,public X-Google-ArrivalTime: 2004-01-11 05:37:32 PST From: Peter_Kahrel@adobeforums.com Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!eusc.inter.net!newsfeed01.sul.t-online.de!t-online.de!webx Newsgroups: adobe.scripting.indesign Subject: JS: cannot add column in table Message-ID: <2ccf4e4c.-1@webx.la2eafNXanI> Date: Sun, 11 Jan 2004 05:33:01 -0800 Lines: 31 MIME-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 8bit