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 editing of metadata. Macros make it possible to add or modify field content, retaining or overwriting the existing metadata in the field. Macros also let you 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.



Select New to create a new macro.

Enter a name for the macro in the Macro name field.

Select Add Field to start adding fields to modify and setting conditions.

In the dialog that opens you can set a number of 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. You can choose between 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) and Replace substring in previous content (lets you replace a string in the specified field with another string).

Field Content: Enter the information that you would like to add to the field in question. Select Insert Code to insert a dynamic operator so that you can add any kind of 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 that have to be met before the macro is executed. Conditions are field-specific, so that a macro can modify the contents of many fields where some are modified whereas others aren’t, depending on whether the conditions set for each field are met.

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

Then pick 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 when you need to replace metadata using or Replace substring..., you may find it useful to use regular expressions to target the existing metadata that 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 make modifications to an entry you create, select the field you want to modify and select Edit or Remove. The above screenshot shows a macro that is 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 a number of ways:

  • With an action, using the Apply metadata template/macro action.
  • From the metadata editor -open the Macro menu and choose the macro one 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.