# Running Actions from the Multi Field Editor

The Multi Field Editor is a convenient place to perform a variety of canned text manipulations which operate on selected files with one or more specified fields. The Multi Field Editor's Actions panel supplies a list of actions which can be run. The list of actions is determined by the Association column in the Action Manager. All actions which have an M in the Association column will be displayed, even if the Hidden column is checked.

When an action is started from the Multi Field Editor, the Action Manager's All Files and Always columns are ignored. (The Multi Field Editor's functions only operate on selected files and the MFE never extends the file selection). Named variable Run from Multi Field Editor will be set to 1. This means that you can test if an action is started from the MFE. The Test Run Context statement can also test if an action was started from the MFE. Note that when starting an action from a function button's Multi Field Editor Actions submenu, the action is being started by the Multi Field Editor.

For consistency reasons an action started from the Multi Field Editor should provide its functionality on all fields which are currently selected in the Multi Field Editor. Note that it is perfectly valid to ignore selected fields which are not appropriate for the functionality being provided. The Multi Field Editor does the same. The selected fields can be determined by using an Extract Preference Set statement with the Supplied Fields Set function. Example:

    Extract the Supplied Fields set to named variable 'Selected Fields'

You can use list manipulation statements to remove those fields which are not appropriate to the function. For example remove all fields which can have multiple values and do not have a default value.

    Extract the Supplied Fields set to named variable 'Selected Fields'
    Create a list of all non simple text fields in named variable 'Exclusions'
    List Manipulate remove all items in 'Selected Fields'(⏎) which match any item in 'Exclusions'(⏎). Save to 'Selected Fields'(⏎)

Here's a complete example which performs two MFE functions by removing leading articles and converting to title case. All fields which should not be modified are ignored:

    Cancel if the current execution context does not support Run from Multi Field Editor
    ' Get the selected fields
    Extract the Supplied Fields set to named variable 'Selected Fields'
    ' Ignore any set fields which we are not interested in modifying.
    Create a list of all plain text fields in named variable 'temp'
    List Manipulate take the intersection of items in 'Selected Fields'(⏎) and 'temp'(⏎). Save to 'Selected Fields'(⏎)
    ' Perform the functionality.
    Removing leading article in fields in named variable 'Selected Fields', as lists with delimiter "⏎"
    Case lower-Title Case in fields in named variable 'Selected Fields' with names, exceptions, replacements and Roman Numerals, process as list with delimiter "⏎"