# The Action Manager

You create, remove, duplicate, rename, export, edit and run actions from the Action Manager. The Action Manager displays the list of actions and also displays the order the actions appear in the Actions>User defined menu. You can drag and drop in the list of actions to manually change the order. The entire Action Manager display can be sorted ascending and descending by clicking on the column headers. You can also sort a selected folder or the folder containing the selected action via the Sort Folder context menu items.

If you have a particular sort order that you would like to retain, you can save it by the Save Current Sort Order context menu item. You can return to the saved sort by the Sort by Saved Sort Order context menu item. Note that if you are synching preferences between two Macs by the Auto import/export preferences file option, the saved sort results might be less than desired. The saved sort order information is ignored when importing actions. Use of the Priority column may be a better alternative.

The Priority column is only used as a means of enforcing a certain sort order. The Priority column is enabled on actions and folders. The initial priority of all items is · which represents the lowest priority (or 10). You can change the priority to values of 1 for highest through 9 for next-to-lowest. You can explicitly set a priority to one or more selected items via the context menu's Priority sub menu. You can also select a single item and click in the Priority column to do the same on a single item. By setting priorities and then sorting by priority, you can enforce a desired sort order. Remember that if you want to sort from highest to lowest, you want a descending sort.

You can change the version number of one or more actions by selecting the actions and using the Set Version menu item on the context menu. You can also select folders. When a folder is selected, all contained actions will have their version modified. Note the folders inside a selected folder are not processed (unless they are also selected). The search for actions inside a selected folder is shallow not deep. If an action does not have a Version statement, one will be created. The version statement will be placed so that any leading descriptive text accessed by the Description context menu item will be preserved.

The version column displays the value associated with a Version statement contained in the associated action.

All of the functionality of the Action Manager is accessed via the context menu.

Actions can be placed into folders which makes it easier to manage a large number of actions. Folders are created via the New Folder context menu item.

You can mark an action as automatically selecting all files by clicking on the appropriate checkbox in the table.

Actions require at least one selected file in order to run. However, many Yate actions are designed to operate without requiring any files. If the Always checkbox item is set, the associated action will be permitted to execute if there are no open files. If there are files loaded but none are selected, one file will automatically be selected. If no files are loaded a temporary file will be loaded and selected. The temporary file will be removed when the action terminates (unless it has been renamed or moved). It is the responsibility of the writer of the action to ensure that files are not modified unintentionally. The All Files option ensures that a file is available for the action to run. It does not guarantee that only a single file or a temporary file is selected. Note that if All Files is selected and there are loaded files, it takes priority over the Always setting.

Two named variables may be automatically set when an action is run and Always is enabled for the action:

> File Auto Selected
>   If a loaded file was automatically selected, this named variable will have a value of 1
> Temporary File Supplied
>   If a temporary files was supplied, this named variable will have a value of 1

By default an action will only appear on the User Defined Actions menu. If you have written an action which extends the capabilities of the File to Tag, Rename, Search for Artwork functionality, or is designed to be run from a database viewer or the Multi Field Editor, you can specify that the action should also be placed into the associated menu or table. The following indicators are used in the table: D for Database, F for File to Tag, M for Multi Field Editor, R for Rename and S for Search for Artwork and · for no special association. You use the Add Association context menu item to configure one or more selected actions. You can also select a single action and click in the Association column to configure it. Information on constructing actions to be run in the Multi Field Editor can be found in Running Actions from the Multi Field Editor. More information on using actions with databases can be found in The Database Viewer.

If you have an action which is a helper action called by another and you do not want it to appear in the menus used to choose an action, you can click on the checkbox in the hidden column to hide the action. Note that the Hidden option only effects menus where you would choose an action to run. It does not effect menus used in the action statement configuration panels. Nor does it affect actions which are targetted to specific menus.

To edit an action, select a single action and choose the Open context menu item. You can also double click on an action to edit it. If a folder is selected when you choose the Open context menu item, all actions in the folder will be opened. Sub folders will not be processed.

You can display a popup window which contains an action's description by means of the Description... context menu item. An action's description is the first non empty content in a Comment, Force Grouped, Tooltip or Version statement. A search for a description is terminated at the first enabled statement which is not one of the preceding statements or an Empty Line or Constrain Execution to a Single File statement. Hitting the space bar has the same effect as selecting the menu item.

Newer actions downloaded from the resources web page can easily have the resources documentation displayed. The Resource Documentation... context menu item will open the documentation in a browser window.

When you drag to the application icon or use the Finder's Open With command, the default action if there is one, will automatically be run. You select the default action by choosing an action in the table and by clicking on the Set as the Default Action menu item. If the Set as the Default Action menu item has a checkmark, it implies that the default action is currently set. The default action is identified by a ✓ icon. You can use the Preferences-Actions Only run the default action if Yate is not already open setting to limit when the dfault action is run.

The main window supports ten toolbar buttons to run actions. The toolbar buttons are named Action 1, Action 2 ... Action 10. You associate an action with one of the toolbar buttons by choosing an action in the table and by clicking on a Set as Toolbar Action># menu item. A # menu item with a checkmark implies that the toolbar icon is currently associated with an action. The toolbar button will have a tooltip representing the name of the action followed by the contents of a Tooltip statement, if there is one. If toolbar button labels are displayed, by default the label will be Run action n. You can implicitly specify a portion of the action name is to be used as a button label by enclosing the desired text in square brackets. eg. Rename and [Move] files. You can also associate your own custom images with any of these toolbar buttons. You do so via Preferences-File List-Configure toolbar action icons.

Note that any given action can have at most one special association. It can be the default action or associated with one of the action toolbar items. The Clear Special Status context menu item will remove any of the associations without assigning them to another action. Note also that moving an item to the trash automatically removes any special associations.

You can assign an icon to actions and action folders in order to differentiate them for identification purposes. You assign the icons by means of the Set Action Icon and Set Folder Icon context menu items. These icons will not be displayed if the action already has a special association. The Functions submenu contains icons which can be used for those items which can be referenced in the Association column and those wizards or importers which can automatically run an action after importing.

To create a new action choose the New Action context menu item. You are given the opportunity to edit the name. This method allows you to place a new action within a specific folder or in a specific location. New actions can also be created outside of the Action Manage by selecting the Actions>New Action menu item.

To remove actions and/or folders, select one or more items and choose the Move to Trash context menu item. Yate maintains a trash bin for all actions which are removed. The contents of the bin persists until the application terminates. You may move items in and out of the trash bin. If you reset the action list via Reset Preferences or Reset Built In Items, the entire previous set of actions will be available in the trash.

To duplicate an action, select an action and choose the Duplicate context menu item. The action will be duplicated and you are given the opportunity to edit the name.

You can move folders and actions to another folder by means of the Move to Folder context menu item. You cannot move a folder to a location which already contains a folder of the same name or to a descendent folder. To move outside of all folders, select root as the destination.

To rename an action or folder simply edit the name inline. All references to the renamed action will be updated.

To export actions, select the actions to be exported and choose the Export... context menu item. When a folder is selected, the operation performed depends on if the folder is expanded or collapsed. The following rules are applied:

The folder is collapsed
  All of its contained actions will be exported.
The folder is expanded
  Only contained items which are selected will be exported.

When exporting, you are performing a smart export. All directly referenced actions, Rename templates, File to Tag templates, Search templates, Export sets, Tag sets and other items are automatically exported as well. Further, all Custom Field accesses are exported in such a way that they can be conditionally remapped when imported. You will be provided with the option of supplying an identifier to be prepended to every component's name. This is extremely useful if you are sending us the exported file to look at. When doing an export, folders are not preserved. You can however, supply a name for a folder to contain all exported actions. This folder name is only guaranteed to be created if the actions do not already exist when imported. Note that items which are indirectly referenced will not automatically exported. You can force these items to be exported by specifying them on an Include statement. The produced file is a plist file. If you specify Export as a zip file the produced file will be zipped and the plist file will be deleted.

To run an action, select a single action and choose the Run context menu item. You can also do this by holding down the Option key and double clicking on an action.

If you want to see the usage for all actions select the Log Action & Debug Usage context menu item. The LogViewer will display a list of all actions. Each action will display two sublists. The first sublist, Calls, will display a list of all (non inline) actions called by the action. If no actions are called, Calls none will be displayed. If any action is called more than once, its name will be followed by (#) where # is the number of calls. The second sublist, Called by, will display a list of all actions which call this action. If there are no callers, Called by none will be displayed. If a caller calls more than once, the caller's name will be followed by (#) where # is the number of calls. The function also logs all actions which contain a Debug statement or any statement marked as being a debug statement.