Skip to main content
Documentation & User Guides | Fotoware

Creating a macro to modify metadata

The feature is only available in FotoStation Pro and Client


In addition to templates, FotoStation can use text macros for more advanced automated metadata editing. Macros make it possible to add or modify field content while retaining or overwriting the existing metadata in the field. Using macros, you can also specify conditions that must be met before the metadata is modified.

Creating a text macro

Where: Expand the Metadata node, then expand the Text macros node.



  1. Select New to create a new macro.
  2. Enter a name for the macro in the Macro name field.
  3. Select Add Field to add fields to modify and set conditions.
  4. In the dialog that opens, you can set several parameters:


  • Field to Add: Choose the field whose contents you wish to modify in this drop-down list.
  • Action: Select how you would like to modify the field. The following options are available: 
    • Clear Field  - clears all metadata in the field
    •  Add to previous content - appends the information you choose after any existing information in the field
    • Replace all previous content - overwrites any existing information with your new information
    • Add substring in previous content - makes it possible to add information to a field directly after a specified string
    • Replace substring in previous content - lets you replace a string in the specified field with another string
  • Field Content: Enter the information you want to add to the field in question. Select Insert Code to insert a dynamic operator to add any information from other XMP fields, file properties, or digital camera information fields to the field you are modifying.

Setting conditions

When configuring a text macro, you can define conditions to be met before the macro is executed. Conditions are field-specific, so a macro can modify the contents of many fields where some are modified whereas others aren’t. This depends on whether the conditions set for each field are met or not.

To enable conditions, select Only if the following condition is met.

Then select a field from the drop-down list (often the same field as the one you want to modify), choose the condition operator (Contains, Does not contain, Is empty, Is not empty), and enter the string in the field below if you chose Contains or Does not contain.

Using regular expressions in macros

When setting macro conditions or replacing metadata using Replacesubstring, you may find it useful to use regular expressions to target the existing metadata you want to modify. To insert a regular expression in the condition or replacement field, enter rx immediately, followed by the regular expression in curly brackets.

For example: 

rx{REUTERS\/[a-zA-ZæøåÆØÅ\- ]{2,}$}

Modifying or deleting a text macro

To modify an entry you create, select the field you want to modify and select Edit or Remove. The above screenshot shows a macro set to replace the contents of the Caption field regardless of what’s already there, then add a copyright string if the Copyright field does not already contain any information.

Importing and exporting text macros

Having selected the Metadata Macros node (under the Metadata node) in the configuration tree, you can select Import under the list of macros to import a macro from a file. Macros can be imported from .fmm files (FotoStation 6.0 XML-based files) and .ipm files from older versions of FotoStation.

To export a text macro, select it in the list and select Export. Exported text macros will be stored in XML-based format with the extension .fmm.

Applying metadata to files using your macro

To use the macro you have just created, you can apply it in the following ways:

  • With an action, use the Apply metadata template/macro action.
  • From the metadata editor - Open the Macro menu and choose the macro you want to apply.
  • From the context menu - Select a range of files and use the Stamp tool on the toolbar to apply the metadata to all the files.

Filtering macros in the menus

When you have a lot of macros, and the majority are only used for automated workflows (in actions, for example), the Macro menu will be overloaded with options that shouldn't be visible to a user. To avoid this, you can apply a menu filter to select which macros to display in the Macro menu. 

  1. Select Manage macros in the Metadata Editor or Stamp tool, or go to Metadata > Metadata macros in the main menu.
  2. Select Edit menu filter. The Macro menu filter opens to display all existing macros.


  1. Select the macros you want to display and clear any that you don't want to display.
  2. Select OK. Only the selected macros are available in the Macro menu list in the Metadata Editor and Stamp tool.