Article View: adobe.scripting.indesign
Article #15557Re: Adding a column within a table
From: Olav_Kvern
Date: Fri, 21 Nov 2003 05:04
Date: Fri, 21 Nov 2003 05:04
15 lines
2332 bytes
2332 bytes
Dave-- In the AppleScript example you posted, you actually tell the column to create a new column, as we ended up doing in JavaScript. If you try to tell the table to make a column in AppleScript using the same location reference, I think you'll get the same error. Note that the enum names/values, as mentioned in message #4, above, aren't the problem here--it's that tables can only add rows before/at beginning or after/at end, and that the same is true of columns. Our problem was that we were trying to tell the table where to create a column. The enum decimal values might be wrong, but they weren't what was causing the trouble. The problem is that the add method lists an optional parameter (Reference) that is never used and, as far as I can tell, will cause an error if it is used. If you omit the reference, LocationOptions.before is also interpreted as LocationOptions.atBeginning (which might account for the decimal value discrepancy--I have to research this). That said, before/after/at beginning/at end are pretty much standard AppleScript terms--but they're something we've added to JavaScript/VBScript. You'll also find a bunch of other borrowings from AppleScript there--most of the reference methods (itemByRange, itemByID, etc.) show an AppleScript influence. I think AppleScript's syntax is a bit more forgiving, but I still have trouble getting a filter clause right the first time, or providing method parameters. It's supposed to be like English, and it mostly is--until it wants something like: "make column at before column 2 of myTable". English that ain't!<g> It's very nice when it corrects your code based on what it finds in the dictionary. Thanks, Ole
Technical Details
Message-ID:
<2cce81b1.10@webx.la2eafNXanI>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!fu-berlin.de!newsfeed01.sul.t-online.de!t-online.de!webxReferences:
<2cce81b1.-1@webx.la2eafNXanI>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f939a,620333df8eace87c X-Google-Attributes: gidf939a,public X-Google-ArrivalTime: 2003-11-20 21:07:46 PST From: Olav_Kvern@adobeforums.com Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!fu-berlin.de!newsfeed01.sul.t-online.de!t-online.de!webx Newsgroups: adobe.scripting.indesign Subject: Re: Adding a column within a table Message-ID: <2cce81b1.10@webx.la2eafNXanI> Date: Thu, 20 Nov 2003 21:04:38 -0800 References: <2cce81b1.-1@webx.la2eafNXanI> Lines: 36 MIME-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 8bit