Skip to main content
Participant
March 8, 2024
Question

ESTK System Variable Question

  • March 8, 2024
  • 1 reply
  • 204 views
I'm trying to write my first script and I ran into a problem. I don't understand how to save the real value of a system variable to a variable. I only get the building blocks, not the value.
I'm sorry, I understand that this is a very stupid question.
    This topic has been closed for replies.

    1 reply

    frameexpert
    Community Expert
    Community Expert
    March 8, 2024

    Please post your code.

    SofyaShuAuthor
    Participant
    March 8, 2024

    var book = app.ActiveBook;
    var shortBookName = new File (book.Name).name;
    var comp = book.FirstComponentInBook;
    var i = '';
    while (comp.ObjectValid())
    {
    var compName = comp.Name;
    Open (comp.Name, GetOpenDefaultParams(), new PropVals());
    var doc = app.ActiveDoc;
    var shortName = new File (doc.Name).name;
    var page = doc.LastBodyPageInDoc.PageNumString;
    i += shortName +" last page " + page + "\n";
    doc.Close (1);
    comp = comp.NextBookComponentInDFSOrder;
    }
    var doc = SimpleNewDoc ("C:\\Program Files (x86)\\Adobe\\Adobe FrameMaker 2019 (32 Bit)\\SHELLNEW\\FrameMaker2015.fm", false);
    var mainflow = doc.MainFlowInDoc;
    var tframe = mainflow.FirstTextFrameInFlow;
    var pgf = tframe.FirstPgf;
    var tLoc= new TextLoc();
    tLoc.obj = pgf;
    tLoc.offset = 0;
    doc.AddText (tLoc, shortBookName + "\n" + i);

    SofyaShuAuthor
    Participant
    March 8, 2024

    Я пыталась получить короткое имя файла, но пока смогла сделать только так.