Copy the code below to a text file and save it with a .jsx extension. Open your FrameMaker book, and choose File > Script > Run and select the script. It will create a text file in the same folder as the book that has a list of the file names.
#target framemaker
main ();
function main () {
var book;
book = app.ActiveBook;
if (book.ObjectValid () === 1) {
if (book.Name !== "") {
processBook (book);
}
else {
alert ("Please save the book and run the script again.",
"www.frameexpert.com");
}
}
}
function processBook (book) {
var file, bookComp, compFile;
// Make a text file in the same folder as the book.
// It will have the same name as the book but with a txt extension.
file = new File (book.Name.replace (/[^\.]+$/, "txt"));
file.open ("w");
bookComp = book.FirstComponentInBook;
while (bookComp.ObjectValid () === 1) {
compFile = new File (bookComp.Name);
file.writeln (File.decode (compFile.name));
bookComp = bookComp.NextBookComponentInDFSOrder;
}
file.close ();
}