Article View: adobe.scripting.indesign
Article #16930Tabellenspalten dynamisch erstellen (AS)
From: Dieter Twenning
Date: Tue, 22 Jul 2003 10:03
Date: Tue, 22 Jul 2003 10:03
102 lines
4070 bytes
4070 bytes
Hallo,
ich besch�ftige mich seit zwei Wochen mit AS.
Ich m�chte Daten, die ich aus FileMaker selektiere in InDesign einlesen.
Klappt auch soweit. Nun habe ich eine Tabelle mit zur Zeit statische Spalten�berschriften und -inhalte. Diese m�chte ich nun allerdings dynamisch aufbauen. Also wenn die Spalte eine relevanten Inhalt hat => anzeigen sonst nicht.
Ein Bekannter sagt mir ich k�nnte das �ber ein Array realisieren. Verstanden ja, allerdings mit dem Umsetzen klappt es nicht so sehr :-(((
Ich habe mal den Quelltext soweit eingek�rzt das es nur noch drei Spalten gibt. Durch den Inhalt der Datenbank k�nnen allerdings mal nur eine Spalte oder auch zwei oder alle gef�llt werden.
F�r Hilfe bin ich dankbar.
PS. : Jeder Anfang ist schwer
set Musterpfad to "Macintosh HD:Musterseite"
tell application "FileMaker Pro"
tell database "kv_grunddaten.fp5"
set GID to cell "ID" of every record as list
end tell
repeat with i from 1 to count GID
tell database "kv_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 {"Anschlussgewindegr��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 {"Anschlussgewindegr��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 ("Farbe")
set contents of cell 3 of row 1 of myTable to ("Anschlussgewinde")
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
Danke und Gru�
Dieter
Technical Details
Message-ID:
<1dea03a1.-1@WebX.la2eafNXanI>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-08!supernews.com!priapus.visi.com!news-out.visi.com!petbe.visi.com!news.tele.dk!news.tele.dk!small.news.tele.dk!eusc.inter.net!newsfeed01.sul.t-online.de!t-online.de!WebXShow Full Headers
Complete Article Headers
X-Google-Language: GERMAN,ASCII X-Google-Thread: f939a,b0d2819f52fe59ab,start X-Google-Attributes: gidf939a,public X-Google-ArrivalTime: 2003-07-22 03:07:34 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-08!supernews.com!priapus.visi.com!news-out.visi.com!petbe.visi.com!news.tele.dk!news.tele.dk!small.news.tele.dk!eusc.inter.net!newsfeed01.sul.t-online.de!t-online.de!WebX Newsgroups: adobe.scripting.indesign Subject: Tabellenspalten dynamisch erstellen (AS) Message-ID: <1dea03a1.-1@WebX.la2eafNXanI> Date: Tue, 22 Jul 2003 03:03:27 -0700 Lines: 116 MIME-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 8bit