Copy link to clipboard
Copied
I'd like to create paragraph markers via ExtendScript for heading paragraphs without existing markers, and wonder how to set a correct MarkerText property of a marker. When a cross-reference to a Heading is created manually in FrameMaker, it seems FrameMaker creates a new marker wih the MarkerText property set according to the following format:
<magicNumber>: <pgfFormatName>: <pgfNumber> <somePgfText>
where
Example:
69752: H2,1.1: 1.1 Example text of a level 2 heading
The <magicNumber> element (69752 in the example) is what I don't understand. It seems to be unique within a document (maybe even unique within a book), and I assume it matters for keeping cross-references consistent (e.g., when heading numbers and/or text change). Thus, I'm wondering the following:
Cheers
Johannes
Copy link to clipboard
Copied
The magic number isn't really magic, it is simply a unique identifier for a FrameMaker object. Most objects have a Unique property which is like a serial number for that object. Within a document, that number should be unique to a particular object; for example, each paragraph in a document will have a Unique property value that no other pargraph in the document has.
When building a Cross-Ref marker with ExtendScript, it doesn't really matter what number you use; the idea is just to build a totally unique string for the marker so that it is unique within that document. When I do it, I usually use the new marker's Unique property for the Unique property of the paragraph that contains the marker.
Another reason for using the
<magicNumber>: <pgfFormatName>: <pgfNumber> <somePgfText>
combination is that it makes the Cross-Reference dialog box show the resulting cross-reference as a paragraph cross-reference instead of a spot cross-reference, which is usually more useful for the end user.
There must be some built-in algorithm for generating the "magic" marker text, but I don't think it is exposed to ExtendScript. You will have to build your own, but now you know the pattern, you should be able to code it.