I just got the task to insert a certain text on empty pages inside a .fm file (the empty page is always the last page of each file).
I already took a look at how to insert a paragraph (How to insert a new paragraph? ). But that only adds a paragraph right behind the last one. Since I do not have a paragraph on the page that I want to insert the text to, I wonder which element I could use to insert the paragraph right at the beginning of that page. Does anyone have a clue how that could be done?
Kind regards, Tom
It depends :-). Is the last page part of the main text flow? Or is it a disconnected page?
that last empty page is part of the main text flow, I think.
I am assuming the text reads something like "this page is intentionally left blank". You do not need any scripting for this. Let me know if you are using single-sided or double-sided documents, plus whether you are working in structured Frame or not and I will reveal the solution here. It is simple once you see it.
yes, that is round about what shall be inserted. The documents are double-sided and structure.
Thank you in advance!
P.S.: I am also still interested in a solution via scripting since I want to learn about that as well.
You can learn about scripting doing other stuff, I am sure. For this problem, no scripting is required (and it would be really hard to make it work in structured content, anyway).
I am assuming that chapters are always starting on the right page, but if that is not the case for you, the solution is still the same. You open the master pages and copy the Left page to a new one an call it Left_NotEmpty. Then you place a text line with the required message on the Left master page.
Save the doc and return to the body page view. You will now see the "page blank" message appearing on every Left page (which is not really what you wanted for all pages but that is OK - we will fix it). Now you need to run the Apply Master Pages command at least once. This creates a StructMasterPageMaps table on one of the Reference pages. In that table, you insert one or more new lines that cause the Left_NotEmpty page to be applied whenever an element is present on the left page. You need to catch all block elements or at least one that will always be there. You can also use paragraph tags. The idea is that whatever content appears on the page, it will call out the Left_NotEmpty page. When there is nothing on the page, the Left page will automagically show the message that the page was intentionally left blank (or something else to your liking).
Kind regards from the "Frame Tamer"