Grok Table to Scribus - insert_table.py ====================================== Timestamp: 2026-11-11 12:23 Proposed Workflow ----------------- 1. Prompt Grok with your table data: "Make a 180 mm width table for Scribus from this table." (If no width is given, Grok should default to 180 mm = 210 mm page - 2 × 15 mm margins.) 2. Grok answers with ready-to-copy text in this format: | Header 1 | Header 2 | Header 3 | | Data row 1 col 1 | 12.5 | 10 mm | | Data row 2 col 1 | Data row 2 col 2 | Data row 2 col 3 | - Optional: WIDTH:xxx or ROWHEIGHT:x (can override the dialog values) - Rows: cells separated by | - Lines starting with # are ignored 3. In Scribus: - Open your document. - Create a frame (text frame or any object) as a placeholder at the position where the table should appear. - Select that placeholder frame. It must be empty. - Script → Execute Script → choose insert_table.py - In the dialog: - Width (mm): default 180 - Row height (mm): default 6 - Background top: dropdown, default Grey-20 - Background alt: dropdown, default Grey-5 - Text style: dropdown of paragraph styles, default Table - Paste the text from Grok and click "Insert Table". 4. Result: - Individual text frames for every cell. - Top row has the chosen background color (default Grey-10). - Subsequent rows alternate: no background, then the color, etc. - Cells whose content is only a number or a number with a unit are right-aligned. - Paragraph style applied (default "Table") if it exists in the document. - Full-row background rectangles (polygons) alternating Grey-20 / Grey-05. - Text frames start 1 mm below the background and have no fill/stroke. - No cell borders. - The selected placeholder frame is deleted when finished. Error messages: - "No placeholder selected." — if nothing is selected. - "The selected placeholder has content." — if the selected frame contains text. Notes ----- - Column widths are equal (table_width / number of columns). - Works with Scribus 1.5.x / 1.6+ (Python 3 preferred). Tkinter is used for the dialog. - After insertion you can freely edit each cell frame, group them, change fonts, etc. - "Grey-10" is a standard color in the Scribus greys palette. Make sure it is available in your document (Edit → Colors → Import or use the default palette). - Create a paragraph style named "Table" (or choose another in the dialog) for consistent cell formatting. Example Grok prompt for a sample table: --------------------------------------- Make a 180 mm width table for Scribus from this table: | Product | Qty | Price | |---------|-----|-------| | Apple | 10 | 1.20 | | Banana | 5 | 0.80 | Expected Grok output (ready to paste): | Product | Qty | Price | | Apple | 10 | 1.20 | | Banana | 5 | 0.80 |