Script doesn't perform action at start on additionally opened file (fixed)

Script doesn't perform action at start on additionally opened file (fixed)

1
NewbieNewbie
1

    Jun 25, 2022#1

    I created a script with name bottom.js with just one line:

    Code: Select all

    UltraEdit.activeDocument.bottom(); 
    I start it from command line with:

    Code: Select all

    uedit64 d:\temp\test.txt /s="d:\temp\bottom.js"
    The file opens at the first line. The caret goes to the bottom of the file when I run the script from the ribbon Advanced by clicking on command Play script.
    The file opens at the bottom if I create a macro with the command Bottom and run it from command line with using the option /m=.

    6,675585
    Grand MasterGrand Master
    6,675585

      Jun 25, 2022#2

      It looks like a bug existing according to my tests since UltraEdit for Windows v28.10.0.0. The script is executed before the opening of the file finished.

      I found that out by doing the same as you with the difference that the script file contains the line:

      Code: Select all

      UltraEdit.outputWindow.write("Number of files: " + UltraEdit.document.length.toString(10));
      There is output in the output window by this line with UltraEdit v28.10.0.0 and later versions: Number of files: 0

      The same procedure with UltraEdit for Windows v28.00.0.114 and former versions write into the output window: Number of files: 1

      I suggest to report this issue to UltraEdit support by email to get it fixed in a future version.

      I could find out further with modifying the script to the lines below that UltraEdit v28.10. and later run always first the script and does not load the files before script execution finished. In other words the option /s is not working anymore at all on one or more files specified also on the command line to open.

      Code: Select all

      for (var nLoopCount=0; (nLoopCount < 10000000) && (UltraEdit.document.length == 0); nLoopCount++);
      UltraEdit.outputWindow.write("Nunber of files: " + UltraEdit.document.length.toString(10));

        May 17, 2023#3

        This issue is fixed with UltraEdit for Windows v2022.1.0.90 (29.1.0.90) and UEStudio v2022.1.0.90 (22.1.0.90) which are the first public released versions of UE/UES v2022.1.

        The execution of UE/UES with one or more files to open and with a script to run on the opened file(s) does not work for UltraEdit for Windows of version 28.10 to 2022.0 (29.0) and UEStudio of version 21.10 to 2022.0 (22.0). It is necessary to open the file(s) with scripting command(s) by the script itself on using such a version of UE/UES.
        Best regards from an UC/UE/UES for Windows user from Austria