Overview - Macros

What is a macro?

Which functions can you use in a macro?

Which function parameters are used in a macro?

How can you run macros?

How do you save macros?

See also

Tool Window - Macro Manager

Overview - Batch Process for macros

Working with 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.

back to top

Which functions can you use in a macro?

Recording commands

While 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 actions

When 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 functions

Certain 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:

User Message / Delay

Beep

back to top

Which function parameters are used in a macro?

Recording function parameters

Numerous 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 macro

You 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 Icon_Settings, located to the right of the function's name.

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 Icon_RunSilently will appear.

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 Icon_RunInteractively.

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 Icon_RunSilently indicates that a particular document is active in the document group. When you change the execution mode, the Activate Document dialog box will open when you run the macro. Here, you can select the document you want.

Restrictions when function parameters are being recorded

Note: 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.

back to top

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 macro

Note: 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 macros

There are a number of ways in which you can run macros. You will find an overview of the possibilities here.

back to top

How do you save macros?

Macros need not explicitly be saved

A 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 macros

Note: 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 icon_standard_palette. To do that, use the Publish Macros... command.

Exporting and importing macros

Macros 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.

back to top

00344 13042013