Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #29381
    hihihlo
    Participant

    below macro output “act=[]” !!
    OutputBar.writeln(“act=[” + editor.ActiveDocument + “]”);

    OS : windows 11 64bit
    Version : EmEditor Professional (64-bit) 22.5.2
    thanks~

    #29383
    Yutaka Emura
    Keymaster

    You will have to write a property or method for ActiveDocument. For instance,

    alert( editor.ActiveDocument.Name );

    #29385
    hihihlo
    Participant

    thank you ! below code can work :

    
    editor.NewFile();  
    var NewDoc = editor.ActiveDocument;
    editor.OpenFile(sFullFn, 0, eeOpenDetectAll);  //if goal not open : open inplace;  if goal open already : switch to goal document
    if (editor.ActiveDocument.FullName != NewDoc.FullName)  //empty NewDoc is leftover if goal open already, so close it
        NewDoc.close();
    

    but below work in old version (unsure which version)
    if (editor.ActiveDocument != NewDoc) ...
    so I must modify many code from “doc1 != doc2” to “doc1.FullName != doc2.FullName”

    it is incompatible with old version

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.