Error opening file (macro) on startup

Error opening file (macro) on startup

3
NewbieNewbie
3

    Feb 26, 2009#1

    I have a problem with the macro auto load feature. Every time I start UE it pops up errors like:

    [Macro Load]"Error Opening File: C:\Program Files\UltraEdit\Macros.MAC MacroAutoRun=Blanks".
    [Macro Load]"Error Opening File: C:\Program Files\UltraEdit\Macros.MAC MacroAutoRun=".
    [Macro Load]"Error Opening File: MacroAutoRun=Blanks".

    I recorded the macro for some fast blank removal and formating of SQL result tables. No matter.

    I tried deleting all lines in the "Set auto load..." window, filling it up, deleting the .MAC file,...

    Any idea why it cannot load the file?

    6,604548
    Grand MasterGrand Master
    6,604548

      Feb 27, 2009#2

      Can you pack your macro file with ZIP and attach it to your next post? I tried several things with my automatically loaded macro file specified at Macro - Set Auto Load and never got an error except as I specified a macro for execution which does not exist in the macro file.

      BTW: Which version of UltraEdit do you use? I used v14.20.1.1008 for my tests.
      Best regards from an UC/UE/UES for Windows user from Austria

      3
      NewbieNewbie
      3

        Feb 27, 2009#3

        Here's my macro file. I have UE 14.20.1.

        Attachment removed by Mofi.

        6,604548
        Grand MasterGrand Master
        6,604548

          Feb 27, 2009#4

          Okay, your macro file is not damaged. I played a little more with the dialog and I think I have found the problem.

          It looks like you have once entered trailing spaces in the field Macro Name to Execute and these spaces are stored in uedit32.ini and also always loaded. But when opening the dialog and clicking into the edit field for the macro name, it is really blank (= does not contain spaces). It looks like the string is always trimmed right in the dialog, but saved/reloaded into uedit32.ini with the trailing spaces.

          Interesting is also that specifying a macro name, closing the dialog, closing UltraEdit, restarting UltraEdit, opening the dialog again, removing the macro name, closing the dialog and closing UltraEdit does not eliminate the trailing spaces in uedit32.ini. So on next start of UltraEdit the error message is back. The entered macro name is inserted between = and the trailing spaces in uedit32.ini.

          To fix that problem you have to do following:
          1. Create a copy of uedit32.ini normally stored in %appdata%\IDMComp\UltraEdit\ while no instance of UltraEdit is running.
          2. Open this copy of uedit32.ini with UltraEdit and search for MacroAutoRun= in group [MacroAutoLoad].
          3. Remove all trailing spaces on that line and save the corrected copy of uedit32.ini.
          4. Close UltraEdit and replace uedit32.ini with the corrected version.
          Now the problem is gone.

          I will report this issue to IDM. UltraEdit should not trim trailing spaces before writing the macro name into the edit field. Unfortunately it is possible to create macro names with trailing spaces. Therefore UltraEdit cannot simply trim the macro name string after loading from the INI and before saving it into the INI.
          Best regards from an UC/UE/UES for Windows user from Austria

          3
          NewbieNewbie
          3

            Mar 02, 2009#5

            Thank you, this solved the problem, but not quite as you wrote.

            I opened the copy of uedit32.ini in UE and there were no trailing spaces. Then I opened it in Notepad and there it was, a rectangle! :evil: (see image below)

            Heh, sometimes plain and simple Notepad still does it. :mrgreen:
            Macro.jpg (32.54KiB)

            6,604548
            Grand MasterGrand Master
            6,604548

              Mar 02, 2009#6

              Aha, there was a carriage return without line-feed. Well, UltraEdit corrects such a "mistake" by default automatically and interprets the carriage return without a line-feed also as line ending. That's the reason why you could not see that mistake in the INI with UltraEdit. If you would have saved the loaded INI after making a dummy change, the wrong line ending would have been corrected by UltraEdit. With configuration setting Only recognize DOS terminated lines (CR/LF) as new lines for editing enabled at Configuration - File Handling - DOS/UNIX/MAC Handling you would have seen also with UltraEdit a rectangle character.

              However, your problem is fixed and I have already received the answer from IDM support that the problem with the whitespaces I reported was reproducible and the bug report was forwarded to the developers.
              Best regards from an UC/UE/UES for Windows user from Austria