Get( PageNumber ) is only relevant in Preview mode, or when printing. Replace can only be used in Browse mode.
I don't think FMP would be suitable for generating a table of contents. Probably better to export the data to Word or InDesign.
What's your suggestion to create a suitable Table Of Contents?
It's possible, but it's quite labor-intensive (unless you have a fixed number of records per page, then it's rather trivial) - see:
I'm not aware of any FMP internal solution to merge several PDFs.
You can append to an existing PDF when you save a new one.
Yes - as shown over there you have to switch for every record between preview and browse mode.
And you have to re-paginate once for every record, to the very end.
Personally, I would not use "show all records" since I want it on the current subset only. Thus I'd use a new window and do just the loop part over there.
> Get( PageNumber ) is only relevant in Preview mode, or when printing. Replace can only be used in Browse mode.
You're right, that's how it is. However, it could be implemented better...
> I don't think FMP would be suitable for generating a table of contents.
It sucks - although it can be done, painfully.
> Probably better to export the data to Word or InDesign.
No thanks, I doubt that Word would do proper sliding and multi column design - although its paragraph options (keep together, orphans etc) would be much more powerful than FMP's options for headers/footers.
It's working now with sufficient speed.
A) a TOC is built on a subset of records only, typically the first record after a break condition.
Thus the preview has to be created only for the records up to the first one after the break
B) single record omission is time consuming. Instead, the loop should run backwards, until the break condition does change. Then step two records forward and do omit all those records after, in a block of "999999" records. That's done much faster.
Add the typical refresh and freeze window commands for speed.
First it could walk through thousand records per hour (10 000 records and 100 pages within one PDF). Now it's down to about two minutes for a single PDF TOC.
Well yes: if your TOC indexes groups of records, then the script should work with groups too. In such case you don't need to loop at all - you can simply jump to the next (or previous) group, using a summary field à la Edoshin's Fast Summaries method.