2009/10/12 Emma Glaisher <[email protected]>
>
> At present my export
> fields are calculated for each product, so it's something like ProductName,
> return, (ID tags) ProductDescription, return, (ID Tags) Was price (ID Tags)
> Now price
Okay, so how about something along the lines of this psuedo-coded script:
Set Variable [ $buffer; "" ]
Go To Layout [ Products ]
Find Records [ desired criteria ]
Sort Records [ desired sort order ]
Go To Record [ First ]
Loop
Set Variable [ $buffer; $buffer &
Products::ProductName & "¶" &
Products::ProductDescription & "¶" &
Products::Was Price & "¶" &
Products::Now Price & "¶"
Go To Record [ Exit After Last; Next ]
End Loop
Go To Layout [ Export ]
Show All Records
Delete All Records
New Record
Set Field [ Export::Text; "<ASCII-MAC>" ]
New Record
Set Field [ Export::Text; Substitute ( $buffer;
[ "¶"; "<0x000D>" ]; /* return */
[ " "; "<0x0009>" ] ) /* tab */
Export Records [ Export::Text field to indesign.txt (tab-delimited) ]
There are other things you'd probably be adding (style definitions
etc) but hopefully this is enough to illustrate the point. The
critical thing in this method is keeping the InDesign file header
"<ASCII-MAC>" in one paragraph at the top of the output file.
Another approach would be to export each of the product records
separately: you would need to create a dummy product that sorts first
and which contains the InDesign header, which you could delete after
export. In each record a calculated field could apply your InDesign
tags, and I'd put the calculation into a global field and use the
Evaluate function so the output can be managed on a setup screen
somewhere.
--
Tim Mansour <[email protected]>
Neologica Print & Promotions ABN 63 904 335 408
Certified FileMaker 10 Developer
Mobile 0405 500 846 : Melbourne in-dial 03 9012 7441