Application icon

Metadata State Statements

Yate maintains three versions of the metadata in a file accessible by the UI and actions. The initial state represents what was in the file when first loaded or after being saved. The current state represents the current possibly unsaved metadata. The editing state represents the metadata at a particular point in time.

When running an action it is possible to save additional snapshots of the metadata in a file to the runtime state stack.

An interesting point to remember is that while the initial state is reset when a file is saved, the editing state and runtime state stack is not. It is therefore possible to revert to a state before files were saved.

In the UI the editing state can be automatically updated depending on settings in Settings - Editing State. The Editing State can be manually modified via the Edit menu.

The following statements are available to manipulate the metadata states. All of the statements operate on a per file basis.


Revert to Initial State

This statement will reset all files to their initial values. Initial values are those values loaded when a file is opened or last saved.


Update Editing State

The editing state becomes a copy of the current state.


Revert to Editing State

The editing state metadata is copied to the current state. Note that if an editing state has not been established, the initial state will be copied.


Exchange Current and Editing States

The contents of the current and editing states are swapped.


Copy Initial State to Editing State

The contents of the initial state is copied to the editing state.


Runtime State Stack

This statement maintains a stack of metadata states in each file's runtime state stack. The stack is automatically removed whenever an action terminates. The stack is a LIFO (last in first out). The following functions are available:

Push Current Values
A copy of the current values is saved on the runtime state stack.

Pop Current Values
The last saved state on the runtime state stack is copied to the current values and is removed from the stack. If there is no saved state, nothing is changed.

Remove Last
The last saved state on the runtime state stack is removed. If there is no saved state, nothing is changed.

Remove All
The runtime state stack, if there is one, is completely removed. This is done automatically whenever an action terminates.

The number of snapshots saved on a file's runtime state stack can be extracted via the \sc escape sequence. Example: save the size of each file's runtime state stack to track variable 0:

Set Variable 0 to "\sc"

Prior to the introduction of this statement many actions modified the editing state to have a recover point. As many users automatically modify the editing state based on their personal preferences, it may be a better idea to use this statement unless you explicitly want to modify the editing state.



Metadata States