Overview - Macros |
|
Which functions can you use in a macro? Which function parameters are used in a macro? See also Overview - Batch Process for macros What is a macro?Your software offers you the possibility to automate work procedures that you use repeatedly. You don't require any knowledge of programming to be able to do this. You simply carry out the complete work procedure in your software. The macro recorder automatically records actions you carry out and commands you use. When you make this recording, you create a macro that you can run again at any time. To record, edit and manage macros, use the Macro Manager tool window. Which functions can you use in a macro?Recording commandsWhile you are recording a macro, commands you use will be added to the entries in the Macro Manager tool window. For example, when you acquire an image by using the Acquire > Snap command, the entry [Snapshot] will appear in the Macro Manager tool window's list of functions. When you then later run the macro, this command will be carried out. Recording actionsWhen a macro is being recorded, not only will commands you use be recorded in the list of functions in the Macro Manager tool window, but also other actions you take. For example, when you activate an image in the document group, the entry [Activate document] will appear in the list of functions. When you later on run this macro, you can also activate an image in the document group at this stage. Note: When a macro is recorded, not all of the actions you carry out, or the commands you use, in the software, will be recorded. Some commands, e.g., Measure > Arbitrary Line..., can't be recorded. You can't use such commands within a macro. Using special functionsCertain functions can only be used within a macro. You can use these functions to change a macro's process flow. For example, interrupting the macro's process flow by means of a message, to give the user time to search for a suitable position on the sample and to focus on it. You can't record a special function together with the other functions. You add a special function to the macro after the recording has been completed. You will find a list of the special functions in the Macro Manager tool window's context menu. Right click on the list of functions to open the context menu. Possible special functions are: Which function parameters are used in a macro?Recording function parametersNumerous commands in your software open dialog boxes in which you can make certain settings. The current settings in a dialog box will also be, by default, shown in the macro. When you then later run the macro, the command will be carried out with exactly these settings. Example: The image processing operation Process > Smoothing Filters > NxN... opens the Filter - NxN dialog box. In this dialog box you can set the strength of the smoothing effect. For example, enter the value 50 in the Size field and the value 5 in the Iterations field to set a strong averaging effect. When you run this macro later on, the image will be averaged with precisely these values, irrespective of which values have been currently set in the Filter - NxN dialog box. Editing function parameters in an existing macroYou can change the function parameters in an existing macro at any time. To do so, activate the function in the Macro Manager tool window, then doubleclick this icon Changing the function parameters while a macro is running.By default, a function uses fixed parameters within a macro. The corresponding dialog box will, in this case, not be opened when the macro is being run. In the Macro Manager tool window's list of functions, to the left of such a function, this icon It is, however, possible for you to specify that the dialog box will be opened while the macro is being run. This makes it possible for the user to change the settings in the corresponding dialog box when the macro is run. To do this, click once in the list of functions, on the icon located to the left of the function. Then the icon will look like this Example: For example, when you activate an image in the document group when recording a macro, the [Activate document] entry will appear in the list of functions. This icon Restrictions when function parameters are being recordedNote: Some restrictions apply when function parameters are being recorded. Where this topic is concerned, you can find detailed examples here. •You can also make a number of settings in a tool window. Not all of these settings will be saved in a macro. •A lot of the commands in your software take general software settings into account, that you can change by using the Tools > Options... command. Not all of the current settings in the Options dialog box will be saved in a macro. How can you run macros?When you run a macro, all of the macro's functions will be carried out in the order they are listed in the Macro Manager tool window's list of functions. Before you run a macroNote: Numerous macros can only be run when certain requirements have been fulfilled. A macro that, for example, combines different image processing functions, can only run when an image has been loaded. If you try to run this macro when no image has been loaded, you will receive an error message. Fulfill the requirements that will enable the macro to run before you run a macro. For instance, load the images that you want to process with the macro. In certain cases, it makes sense to inform the user at the beginning of the macro, what he has to do to make the macro run correctly. You will find a step-by-step instruction on how to insert a user message here. Various ways of running macrosThere are a number of ways in which you can run macros. You will find an overview of the possibilities here. How do you save macros?Macros need not explicitly be savedA macro will be automatically saved as soon as the recording of the macro has been completed. A macro will be saved with the file name extension XVM. This format is a file format exclusive to your software and cannot be opened with other application programs. Publishing macrosNote: Macros will be user dependent saved. Macros that you have recorded will, as a rule, not be visible to other users of the software. Should you wish to make a macro available to all of the software's users, you can publish that macro. All macros that have been published can be recognized by this icon Exporting and importing macrosMacros will be saved on the PC on which your software has been installed. Should you have several software licenses, you can, of course, also use a macro at another workstation. To do this, export the macro, then import the macro file onto the corresponding workstation. To do so, use the commands Export Macros... and Import Macros... . By using this function, you can make a macro available to other colleagues who work at other workstations than yours. 00344 13042013 |