User to user discussion and support for UltraEdit, UEStudio, UltraCompare, and other IDM applications.

Help with writing and playing macros
3 posts Page 1 of 1
PLATFORM: UEStudio 14.xx,

Q: How can I create a new macro such that when the macro creation is done (after I have selected MACRO>>STOP RECORDING from the menus) I have a new '.mac' file that contains a single macro?

When I go to record a new macro the only options I have is to cancel the action or let it save the macro within the already loaded '.mac' file; the file type that UEStudio and UltraEdit uses to store 1 or more macros. I've been using UEStudio for over 5 years now and I have deliberately stayed away from using the macro feature ( except for 2 macros I need for my job ) and I'd like to start using macros more, but I need for each '.mac' file to be a single macro and so far I don't see how that is possible. I know you can have different '.mac' files because there is a menu option within the MACRO menu to load a different '.mac' file, but there is no menu option/command I can find that lets you create a new macro in a new '.mac' file.

UEStudio and UltraEdit use '.mac' files to store macros and each '.mac' file consist of 1 or more uniquely named macros. I find this way of managing macros to be very confusing. I can certainly see the need and benefit of having a way to execute one or more macros in a specified order via a single click or key stroke/command however I would think that would be done by combining each macro or '.mac' file into a macro batch that could either be a different file type or a '.mac' file that instead of having code for a macro has 1 or more other '.mac' files listed.

If you want your macros to be one per file then when you record your macro, use menu Macro->Save All and specify a new .MAC file with whatever name you want. Yes, this will also save any other macros you already have loaded in addition to the new one. However, just load and edit the new .MAC file to remove the macros you don't want in that file.
There are two possiblities to save a new macro into a new *.mac file without containing the already loaded macros:

  1. Macro - Delete All is executed before creating or recording a macro. This results in unloading all macros. Next the new macro is recorded or created manually. Finally Macro - Save All is used and a different name is entered to save the new macro into a new macro file.
  2. Macro - Delete Macro/Modify Properties is used after creating a macro to remove from currently macro collection all the macros not wanted in new macro file. Finally Macro - Save All is used and a different name is entered to save the new macro into a new macro file.
It is possible to create several macros which are executed by a main macro in same macro file as submacros or individually. But several macros in one macro file are mainly used to build a "library" for a specifc use case. For example I have a *.mac files which contains several macros for general text editing. Another *.mac file with macros is for HTML editing used on my HTML projects. A third one is for working on syntax highlighting files (published). And I have a macro file with several macros for sorting INI and REG files (also published). One more macro file also with several macros is for producing several files from two template files (for company usage). And that are still not all macro files I'm using more or less often. Interesting, none of my *.mac files contain just a single macro.

Hint: It is advisable to save macro code also in a text file, best with same name as the *.mac file, but with file extension UEM (or TXT). There is a syntax highlighting wordfile for *.uem files. I do that for

  1. having a human readable version of each macro file as a single bit failure in *.mac file can result in a corrupt macro file which cannot be loaded anymore by UE/UES,
  2. adding comments to the macro code explaining for myself how the macro works. I have above each macro usually a brief description what is the purpose of this macro, sometimes with a BEFORE and AFTER example. The macro properties set for each macro and their hotkeys are also written into the text version of each macro file.
I have of course all *.mac (and *.uem) stored on more than one storage media as dead of hard disk can happen easily at any time.
Best regards from Austria
3 posts Page 1 of 1