Article View: adobe.scripting.indesign
Article #16907Re: Insert Table into InDesign-Document (AS)
From: Olivier Berquin
Date: Thu, 17 Jul 2003 11:49
Date: Thu, 17 Jul 2003 11:49
59 lines
2738 bytes
2738 bytes
Dieter,
Please, try this:
-- Assume that you have color named "Blue"
-- and a paragraph style named "styleBody"
-- in your document
set myColumns to 7
set myRows to 3
tell application "InDesign 2.0.2"
tell document 1
set ColorBlue to color "Blue"
set BlackColor to color "Black"
set styleBody to paragraph style "01-Body"
tell page 1
set myTextFrame to make text frame with properties {geometric bounds:�
{"10 mm", "10 mm", "60 mm", "110 mm"}}
tell myTextFrame
set myTable to make table with properties {row count:myRows, column count:myColumns}
end tell
tell myTable
repeat with i from 1 to myRows
repeat with j from 1 to myColumns
set contents of cell j of row i of myTable to ((i as string) & "-" & j as string)
end repeat
end repeat
-- stroke color of every cells of row 1
set properties of row 1 to {left edge stroke weight:0, right edge stroke weight:0 �
, inner column stroke color:ColorBlue, inner row stroke color:ColorBlue �
, left edge stroke color:color ColorBlue, right edge stroke color:color ColorBlue �
, bottom edge stroke color:ColorBlue, top edge stroke color:ColorBlue}
-- applied the sytle "01-Body" to every cells of row 2
tell insertion point 1 of every cell of row 2
set applied paragraph style to styleBody
end tell
-- fill every cells of columns 3 and columns 4
tell columns 3 thru 4
set properties to {right inset:"4", fill color:BlackColor, fill tint:20}
end tell
end tell
end tell
end tell
end tell
--
Dave,
I never use this construct before ! But I've noticed, for a cell, in the dictionnary:
contents string -- (inherited from the �base cell properties� class) the text in the cell or range of cells.
So, where the surprise ;-)
Oli.
Technical Details
Message-ID:
<1de9f22f.3@WebX.la2eafNXanI>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-08!sn-xit-09!supernews.com!64.152.100.70.MISMATCH!sjc70.webusenet.com!chi1.webusenet.com!news.webusenet.com!peer02.cox.net!peer01.cox.net!cox.net!in.100proofnews.com!in.100proofnews.com!nntp.infostrada.it!newsfeed01.sul.t-online.de!t-online.de!WebXReferences:
<1de9f22f.-1@WebX.la2eafNXanI>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII X-Google-Thread: f939a,bbe268284038525 X-Google-Attributes: gidf939a,public X-Google-ArrivalTime: 2003-07-17 05:07:48 PST From: "Olivier Berquin" <olb@microscript.com> Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-08!sn-xit-09!supernews.com!64.152.100.70.MISMATCH!sjc70.webusenet.com!chi1.webusenet.com!news.webusenet.com!peer02.cox.net!peer01.cox.net!cox.net!in.100proofnews.com!in.100proofnews.com!nntp.infostrada.it!newsfeed01.sul.t-online.de!t-online.de!WebX Newsgroups: adobe.scripting.indesign Subject: Re: Insert Table into InDesign-Document (AS) Message-ID: <1de9f22f.3@WebX.la2eafNXanI> Date: Thu, 17 Jul 2003 04:49:04 -0700 References: <1de9f22f.-1@WebX.la2eafNXanI> Lines: 70 MIME-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 8bit