Article View: adobe.scripting.indesign
Article #16516Tables, Collections, Selection, and Huh?
From: Matthew Frederick
Date: Mon, 01 Sep 2003 05:42
Date: Mon, 01 Sep 2003 05:42
43 lines
2219 bytes
2219 bytes
Greetings, all, and thanks in advance for any assistance you can provide.
The desired outcome: I select a table, I run the script, it sets the first column to a hardcoded width, it sets the second column to a hardcoded width, it sets all of the (one or more) rows to a hardcoded MinimumHeight.
It seems pretty straightforward but I'm having difficulty accessing multiple columns or multiple rows when I've selected the table.
For example, this works fine if I select one column:
For Each sObject In myInDesign.Selection
Select Case TypeName(sObject)
Case "Row"
sObject.MinimumHeight = "1p3"
End Select
Next
But I want to do it for all of the rows in the table I've selected. I thought the following would work, but it's clear that I somehow don't understand the object model or selections or something:
For Each sObject In myInDesign.Selection
Select Case TypeName(sObject)
Case "Row"
For Each sRow In sObject.Rows
sRow.MinimumHeight = "1p3"
Next
End Select
Next
This script has no effect, and importantly once multiple rows (or the table) are selected it never even drops into the
Case "Row"
section, as none of the objects in the selection is a row. That tells me that somehow selecting a whole table means the things it's composed of are... no longer selected? I dunno, hence the mystery.
So, uh... what am I missing?
Again, thanks for any help you can provide.
Technical Details
Message-ID:
<2ccd2f62.-1@webx.la2eafNXanI>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-09!supernews.com!newsfeed.news2me.com!snoopy.risq.qc.ca!in.100proofnews.com!in.100proofnews.com!nntp.infostrada.it!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,dbf123f26daf8769,start X-Google-Attributes: gidf939a,public X-Google-ArrivalTime: 2003-08-31 23:07:28 PST From: "Matthew Frederick" <mfrederick@qwest.net> Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-09!supernews.com!newsfeed.news2me.com!snoopy.risq.qc.ca!in.100proofnews.com!in.100proofnews.com!nntp.infostrada.it!newsfeed01.sul.t-online.de!t-online.de!webx Newsgroups: adobe.scripting.indesign Subject: Tables, Collections, Selection, and Huh? Message-ID: <2ccd2f62.-1@webx.la2eafNXanI> Date: Sun, 31 Aug 2003 22:42:41 -0700 Lines: 42 MIME-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 8bit