🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: adobe.scripting.indesign
Article #16934

Create dynamic table (AS)

#16934
From: Dieter Twenning
Date: Tue, 22 Jul 2003 11:33
85 lines
3843 bytes
Hello, I is occupied for two weeks with AS.
I would like data, which I select from FileMaker in InDesign read in.

Folds also so far.

Now I have a table with at present static column headings and contents. I would like to develop these however dynamically now. Thus if the column does not have relevant contents = > to indicate otherwise.

An acquaintance says to me I could that about an array realize. Understood, however with the shifting it does not fold so much:-(((

I have times the source text so far in-shortened it only three columns give. Can be filled by means of the contents of the data base however times only one column or also two or everything. For assistance I am grateful. HP: Each beginning is heavy

----
set Musterpfad to "Macintosh HD:Musterseite"

tell application "FileMaker Pro"
tell database "grunddaten.fp5"
set GID to cell "ID" of every record as list
end tell

repeat with i from 1 to count GID

tell database "detaildaten.fp5"
set G_ID to cell "G_ID" of (every record whose cell "G_ID" = item i of GID) as list

set a to cell "a" of (every record whose cell "G_ID" = item i of GID) as list
if a != "NULL" or a != "0" or a != " " then
set spaltenbezeichnung to {"Artikelnummer"}
set spalten_nr to 1
end if

set agg to cell "agg" of (every record whose cell "G_ID" = item i of GID) as list
if agg != "NULL" or a != "0" or a != " " then
set agg to cell "agg" of (every record whose cell "G_ID" = item i of GID) as list
set spaltenbezeichnung to {"AGG-Gr��e"}
set spalten_nr to (spalten_nr + 1)
end if

set aggu to cell "aggu" of (every record whose cell "G_ID" = item i of GID) as list
if aggu = "NULL" or aggu != "0" or aggu != " " then
set spaltenbezeichnung to {"AGG-Gr��e- Unterteil"}
set spalten_nr to (spalten_nr + 1)
end if

end tell

tell application "InDesign 2.0.1"
try
open Musterpfad
on error
set Musterpfad to choose file with prompt "Wo befindet sich die Musterseite ?"
open Musterpfad
end try

tell spread 1 of document "Musterseite"
set Seite to make page with properties {applied master:master spread id 121 of document "Musterseite"}
tell Seite

(* Tabelle aufbauen *)
set spalten to spalten_nr
set zeilen to count G_ID
set myTextFrame to make text frame with properties {geometric bounds:�
{"100 mm", "12.7 mm", "284 mm", "197.3 mm"}}
tell myTextFrame
set myTable to make table with properties {row count:zeilen, column count:spalten}
end tell

tell myTable
set contents of cell 1 of row 1 of myTable to ("Artikelnummer")
set contents of cell 2 of row 1 of myTable to ("Gr��e")
set contents of cell 3 of row 1 of myTable to ("Gr��e-Unterteil")
(* This is my problem !*)

repeat with j from 2 to zeilen
set contents of cell 1 of row j of myTable to (item (j - 1) of a)
set contents of cell 2 of row j of myTable to (item (j - 1) of agg)
set contents of cell 3 of row j of myTable to (item (j - 1) of aggu)

end repeat
end tell
end tell
end tell

end tell
end repeat
end tell
Technical Details
Message-ID: <1dea03cb.-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!diablo.theplanet.net!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed.icl.net!newsfeed.fjserv.net!skynet.be!skynet.be!news.tele.dk!news.tele.dk!small.news.tele.dk!lnewspeer00.lnd.ops.eu.uu.net!emea.uu.net!newsfeed01.sul.t-online.de!t-online.de!WebX

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII
X-Google-Thread: f939a,c89b70fa935d667f,start
X-Google-Attributes: gidf939a,public
X-Google-ArrivalTime: 2003-07-22 04:39:35 PST
From: "Dieter Twenning" <info@future4com.de>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-09!supernews.com!diablo.theplanet.net!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed.icl.net!newsfeed.fjserv.net!skynet.be!skynet.be!news.tele.dk!news.tele.dk!small.news.tele.dk!lnewspeer00.lnd.ops.eu.uu.net!emea.uu.net!newsfeed01.sul.t-online.de!t-online.de!WebX
Newsgroups: adobe.scripting.indesign
Subject: Create dynamic table (AS)
Message-ID: <1dea03cb.-1@WebX.la2eafNXanI>
Date: Tue, 22 Jul 2003 04:33:35 -0700
Lines: 99
MIME-Version: 1.0
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit