Frequently used macros that are project-independent can be placed in a particular folder in the file system for automatic detection and execution from the macros menu.

Add/Remove Macros

To add, remove, or update a macro in the Macros Menu, simply add, remove, or edit the *.xmacro file in the specified folder within XF's Application Preferences.

The Macros Menu links to the following default location:

Scripts in folder appear in Macros Menu.

Users can change this location in Application Preferences by working under the General tab and entering a different selection in the Macros Menu portion of the window.

Header Format

By default, the listings in the Macros menu will use the *.xmacro file name, which can be changed by adding a header to the macro file. The header format consists of zero or more comment lines with keywords:value pairs as documented below.
// Name: {menu name}
// Icon: {name of .ico file}
// Created: {date}
// Version: {string}
// Author: {name}
// Modified: {date and author}
// Last Modified: {date and author}
// Description:
// {first line of description}
// {next line of description}
// ...
// {last description line}

The Name:, Icon:, Created:, Version:, Author:, Modified:, Last Modified:, and Description: designations are optional. The Modified: keyword can be specified more than once, whereas other keywords will derive value from the most recent of multiple entries. Authors: is recognized as a synonym for Author:. The designated icon file typically exists in the same folder as the macro, but can also be defined using a relative or absolute path.

Submenus can also be given names, icons, and descriptions by placing the information in a file named menu.desc in the submenu folder using the format described above.

Selecting the Macro Information item at the bottom of each menu opens a dialog that shows the header information. Giving each of the menu's macros a good description is useful because it serves as the help text for that individual macro.

An example of useful annotation can be seen below:

// Name: Markup S-Params Graph
// Icon: Marker.ico
// Created: Oct 1, 2016
// Version: 1.3
// Author: J. Doe
// Modified: Jan 22, 2017 by G. Buck
// Last Modified: Feb 3, 2017 by T. Who
// Description:
// Set the bounds of an existing S-parameters graph to specific
// values, add markers at a set of specified frequencies, and add
// markers at specific dB down levels. If more than one
// S-parameters graph exists, the user will be prompted to select
// the one to modify. The specific values for the bounds and markers
// are customizable in the first section of the macro file.

Limitations

Any output text or error messages produced by the macro will appear in the lower pane of the Scripting window.

Other limitations include the following: