Extendscript: moving chapter to end of FrameMaker book
Colleagues,
I'm trying to figure out _why_ the Extendscript below works, to move a chapter to the end of a FrameMaker book.
I understand that the value of "NextComponentInBook" is always zero for the last book component. But when I explicitly set this property to zero for an arbitrary book component, the current "last" book component already has a "NextComponentInBook" value of zero.
Does Extendscript perform housekeeping to set the "NextComponentInBook" value of the _previous_ last chapter to the _new_ last chapter, automatically?
Perhaps my confusion is in thinking about the list of book components as a conventional linked list, in which I would need to do this housekeeping myself.
TIA,
-Alan Houser
// Get the active book
var book = app.ActiveBook;\
// Add new chapter to book. '0' argument puts it first
var NewLastChapter = book.NewSeriesBookComponent (0);
// Set the name of the new chapter
NewLastChapter.Name = "lastchapter.fm";
// Move new chapter to the end of the book.
NewLastChapter.NextComponentInBook = 0;

