Tapatalk

How to create a macro from a posted macro code?

How to create a macro from a posted macro code?

6,685587
Grand MasterGrand Master
6,685587

    May 18, 2013#1

    The *.mac macro files for UltraEdit/UEStudio are binary encoded files. The macro source code can't be copied into a new text file, saved as *.mac and loaded.

    UltraEdit ≥ 2023.2.0.41 (v30.2.0.41) or UEStudio ≥ 2023.2.0.41 (v23.2.0.41)

    There must be executed the following actions in UltraEdit for Windows and UEStudio with a version 2023.2.0.41 or newer:
    1. Copy the macro code selected in browser window to (Windows) clipboard.
    2. Switch to UltraEdit/UEStudio and click
      in menu Macro on Create macro… with using UE/UES with traditional menus, or
      in menu Advanced in submenu Configure on Create macro… with using UE/UES with contemporary menus, or
      on ribbon tab Advanced in group Macro on down arrow of Configure and click in pop-up menu on Create macro… with using UE/UES in ribbon mode.
    3. Enter a macro name.
    4. Uncheck the macro option Show cancel dialog for this macro,
      except you want to be able to cancel the execution of the macro later by mouse.
    5. Let the macro property Continue if search string not found checked,
      except the user who posted the macro code wrote to uncheck this property.
    6. Check or uncheck Disable screen refresh during macro playback as preferred by you.
      The macro execution is faster on screen refresh disabled during macro playback.
    7. Select all commands in left field of the macro editor dialog with mouse or with pressing Ctrl+A on keyboard.
    8. Press Ctrl+V to replace the selected commands by copied macro source code.
    9. Click on the button Save.
    UltraEdit ≤ 2023.1.0.23 (v30.1.0.23) or UEStudio ≤ 2023.1.0.23 (v23.1.0.23)

    There must be executed the following actions in UltraEdit for Windows and UEStudio with a version prior 2023.2 (UE v30.2 and UES v23.2  in former versioning scheme):
    1. Copy the macro code selected in browser window to (Windows) clipboard.
    2. Switch to UltraEdit/UEStudio and click
      in menu Macro on Edit Macro… with using UE/UES with traditional menus, or
      in menu Advanced in submenu Configure on Edit macro… with using UE/UES with contemporary menus, or
      on ribbon tab Advanced in group Macro on down arrow of Configure and click in pop-up menu on Edit macro… with using UE/UES in ribbon mode.
    3. Click on the button New macro.
    4. Enter a macro name.
    5. Uncheck the macro property Show cancel dialog for this macro,
      except you want to be able to cancel the execution of the macro later by mouse.
    6. Let the macro property Continue if search string not found checked,
      except the user who posted the macro code wrote to uncheck this property.
    7. Check or uncheck Disable screen refresh during macro playback as preferred by you on being available at all.
      The macro execution is faster on screen refresh disabled during macro playback.
      This macro property was introduced with UE/UE v2022.0 (UE v29.0 / UES v22.0 in former versioning scheme).
    8. Close this dialog with button OK.
    9. Select all commands in left field of the macro editor dialog with mouse or
      with pressing on keyboard Ctrl+A if using UltraEdit for Windows ≥ v22.10 or UEStudio ≥ v15.20.
    10. Press Ctrl+V to replace the selected commands by copied macro source code.
    11. Click on the button Close and confirm the question Do you wish to update the macro? with a click on button Yes.

    The macro is now ready for usage. It can be executed, for example, with Macro - Play again (traditional menus), or by double clicking on the macro in the macro list view opened via View - Views/lists - List - Macro list (traditional menus), or by selecting the macro in Macro - Play any/multiple times… (traditional menus). The commands exist also in toolbar menu mode with contemporary menus and in ribbon mode with slightly different names. The submenu List does not exist prior UE/UES v2022.0 in View - Views/lists or as named in older version of UE/UES View - Views/Lists, but the view Macro list does exist also in older versions of UE/UES.

    But you may save the macro first before running it. Use Macro - Save all… (traditional menus) – yes, a macro file can contain multiple macros – to store the compiled macro in a *.mac file.

    Note 1: Prior UE v13.10a+2 and UES v6.30a+2 the macro property Continue if search string not found was named Continue if a Find with Replace not found. But that name was not correct as this property controls in all versions of UE and UES exit or continuation of macro execution when a searched string is not found.

    Note 2: The name and macro properties can be changed later UE/UES ≤ v2023.1.0.23 in the dialog opened with a click
    • in menu Macro on menu item Delete macro/modify properties… on using traditional menus, or
    • in menu Advanced in submenu Configure on menu item Configure macros on using contemporary menus, or
    • on ribbon tab Advanced in group Macro after a click on arrow of Configure on popup menu item Configure macros on using ribbon mode.
    Don't forget to use again Macro - Save all… (traditional menus) respectively Save all macros (contemporary menus and ribbon mode) after making such modifications to store the changes.

    Note 3: It is advisable to store the code, the name and the properties of the macro additionally in a text file for example with the file extension uem (syntax highlighting available for *.uem files) in case the binary macro file becomes corrupt (storage failure) making it impossible to load it. The macro file can be recreated in this case with the text version.