Skip to main content
Participant
November 14, 2023
Question

Create book log via scripting

  • November 14, 2023
  • 1 reply
  • 119 views

Hi,

is it possible to write a script where a book (error) log or something similar can be created? For example, after you update the book on FrameMaker, there is always a new tab/window popping up where a list of errors is displayed. I was trying to find a method or function in the FrameMaker scripting documentation but I didn't succeed.

    This topic has been closed for replies.

    1 reply

    frameexpert
    Community Expert
    Community Expert
    November 14, 2023

    Here is some sample code that shows how it is done:

     

    #target framemaker
    
    var doc, pgf, msg;
    
    // Get the active document and the selected paragraph.
    doc = app.ActiveDoc;
    pgf = doc.TextSelection.beg.obj;
    
    // Make an message to display.
    msg = "This is a " + pgf.Name + " paragraph.";
    
    // Show the book error log with the message.
    writeBookErrorLog (pgf.id, doc.id, 0, msg);
    
    function writeBookErrorLog (objId, docId, bookId, msg) { 
            
        msg = 'log -b=' + bookId + ' -d=' + docId + ' -o=' + objId + ' --' + msg;
        CallClient ('BookErrorLog', msg);
        
        return msg; // Return for troubleshooting.
    }