runTool() does not set Focus to active Document

runTool() does not set Focus to active Document

4

    Nov 03, 2007#1

    I have an external script that writes to the outputWindow. I copy that, process the output, write to activeDocument.

    After it runs, I seem to still be in the "Script List" (this is how I envoked it by dbl-clicking it).
    If I use the popup "Run", it works fine.
    If I envoke it in the Scripting Menu, it works fine.
    It just seems that dbl-clicking in there is my problem.

    How can I set focus back to the ActiveDocument?

    6,684585
    Grand MasterGrand Master
    6,684585

      Nov 03, 2007#2

      What about using this simply code:

      Code: Select all

      // Remember the current active file before real start of the script.
      var CurrentFileIndex = getActiveDocumentIndex();
      
      // Your script code.
      
      // Make the file before script execution again the active file.
      if (CurrentFileIndex >= 0 && CurrentFileIndex < UltraEdit.document.length) UltraEdit.document[CurrentFileIndex].setActive();
      Here is the code for the function getActiveDocumentIndex.

      I hope this works because I have not tested it. If it does not set the focus to the edit window, write an email to IDM support.
      Best regards from an UC/UE/UES for Windows user from Austria

      4

        Nov 03, 2007#3

        Tried it out, but it still does not return focus back to the document.
        I tried "setActive()", but no luck.
        I think its just the way that "double-clicking" on the "Script List" keeps the focus and I do not see a way to "CTRL-TAB" back to the active one.

        For now, I'll just note that this is a problem (for double-click). but the other ways I mentioned all work ok.

        thanks.