Article View: adobe.scripting.indesign
Article #9578Re: JS how to add a new row?
From: Dave_Saunders
Date: Fri, 18 Aug 2006 11:13
Date: Fri, 18 Aug 2006 11:13
16 lines
1145 bytes
1145 bytes
You are a victim of a sporadic transcription problem in the reference guide. When ever you see an enumeration that has "id" at the start of the parts of its name, just lose the "id" and fix the capitalization, if needed -- those are needed in VB but not JS.
myTable = findTable(app.selection[0]);
myTable.rows.add(LocationOptions.atEnd, myTable);
function findTable(obj) {
while (obj.constructor.name != "Table") {
obj = obj.parent;
if (obj.constructor.name == "Application") {
throw "Can't find table"
}
}
return obj
}
Dave
Technical Details
Message-ID:
<3bc14e50.0@webcrossing.la2eafNXanI>Path:
arc1-ca.pugleaf.net!g2news2.google.com!news3.google.com!news.glorb.com!news.ecp.fr!news.stben.net!webcrossingReferences:
<3bc14e50.-1@webcrossing.la2eafNXanI>Show Full Headers
Complete Article Headers
X-Google-Thread: f939a,437803205eff9fb1,start X-Google-Attributes: gidf939a,public X-Google-Language: ENGLISH,ASCII-7-bit From: Dave_Saunders@adobeforums.com Newsgroups: adobe.scripting.indesign Subject: Re: JS how to add a new row? Message-ID: <3bc14e50.0@webcrossing.la2eafNXanI> Date: Fri, 18 Aug 2006 04:13:35 -0700 References: <3bc14e50.-1@webcrossing.la2eafNXanI> Lines: 19 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!news.glorb.com!news.ecp.fr!news.stben.net!webcrossing