Table Of Contents: Get ( PageNumber ) does not work with Replace Field Contents

Discussion created by traut on Mar 29, 2012
Latest reply on Mar 30, 2012 by comment

Am I right that the Get ( PageNumber ) calculation is not supported by the script step Replace Field Contents by calculation?



What I want to do is to create a table of contents.


Thus I have one layout "data" which does display the records which I use in Preview mode to create a PDF from it.


I have to use the preview mode to get proper page numbers. Thus the script would do:


* goto layout "data"

* enter preview mode

* save records as pdf


Then I want to

* replace field contents (pagenumber, get(pagenumber))

* goto layout "toc"

* save records as pdf


That's a layout without body part, but just subsummaries and the pagenumber field.


However, replace field contents does not work in preview mode, which is required for this get command.

The only thing I can do is to loop through record by record and use a set field command instead - very slow, very inefficient.


But even worse: you can't loop through records in preview mode! The goto next does not take the record, but the page!

Let's assume that this would be of any use: You still might use a goto next page and store the get (pagenumber) value.


Have a guess where this info would be saved and how you could use it for a TOC...


What's your suggestion to create a suitable Table Of Contents?


Even better would be to have a single PDF which would have the TOC first, then the data part. I'm not aware of any FMP internal solution to merge several PDFs.