Application icon

Escape Sequences

Most action functions support escape sequences in text fields. All of the escape sequences can be inserted into a text field via a text field's context menu.

Note that alphabetic case is ignored in Yate escape sequences. The following table describes the supported escape sequences, a menu item and description.

When the Menu Item column is black, the sequence can be inserted from a submenu on the Insert Yate Escape Sequence context menu. When it is blue it represents the name of a context menu from which you can choose the named item you desire. Information on each menu can be found below the following table.



SequenceMenu ItemDescription
Action Sequences
\#setting#Insert Runtime Settingis used to insert the value of an action runtime setting
\a1Action Test State (0 or 1)insert the value of the Action Test State as '0' for false and '1' for true.
\a0Action Test State (empty or 1)insert the value of the Action Test State as 'empty for false and '1' for true.
\pName of Calling ActionThe name of the action which called the current executing action. This can return three possible forms:
an empty string
The executing action was called directly from the UI or Batch Processor.
name
name is the name of a non inline action.
name1name2
name2 is the name of an inline action in non inline action name1
Character Sequences
\_Alternate Commainsert an alternate comma () character. In Involved People and Musician Credits fields, real comma characters should only be used as delimiters
\\Backslash Characterthe correct form to specify a single \ character
\.Centered Dot Characterinserts a centered dot character. This can be useful as a replacement character when debugging and looking for spaces in fields
\,List Column Delimiterinsert the default list column delimiter
\~List Delimiterinsert the default list delimiter
\KList Key-Value Delimiterinsert the default key-value delimiter
\:List Secondary Delimiterinsert a secondary list delimiter
\MMulti-Value Delimiterinsert the value of the multi-value delimiter
\nNewline characterinsert a newline character
\-Tab characterinsert a tab character
\&ddddUTF16 Characterdddd must be exactly four hexadecimal characters. The value represents a UTF16 character code. eg. \&000d will insert a Carriage Return character. Note that this sequence is not necessary for visible characters as the Mac Character Viewer can be used to insert any visible character
Date & Time Sequences
\YYCurrent Yearinsert the year
\TDate & Timeinsert the date and time
\DDateinsert the date
\>Time Intervalinsert the time interval in ms since 1970-01-01T00:00:00
\Y4Year Field as YYYYinsert the Year field stripping everything off all date components other than a four digit year. Note that formats of YYMMDD without separators are handled correctly. If a value in the range of 1000 to 9999 cannot be established, an empty string is returned
Directory Paths
\?ASApplication Support Directoryinsert the path to the ~/Library/Application Support directory
\?DODocuments Directoryinsert the path to the Documents directory
\?DLDownloads Directoryinsert the path to the Downloads directory
\HHome Directoryinsert the path to the home directory
\?MOMovies Directoryinsert the path to the Movies directory
\?MUMusic Directoryinsert the path to the Music directory
\?YSYate Application Support Directoryinsert the path to the ~/Library/Application Support/Yate directory
Escape Sequence Control
\LDisable Escape Sequence ProcessingNo further escape sequences are processed in the field. This is useful if you want to insert an arbitrary string which requires backslash characters and you do not want to process Yate sequences. For more information see Delaying & Repeating Escape Processing
\2Repeat Escape ProcessingStrings containing valid Yate escape sequences can be passed around in track and named variables. When a string is processed which contains track or named variables the content of the variables is inserted. If escape sequences were present in the inserted text they will not be processed. If \2 is processed in a string, the string will be analyzed a second time. Note that regardless of how many \2 sequences are present, the repeating will only be performed once. For more information see Delaying & Repeating Escape Processing.
\bSequence Breaka break sequence, nothing is inserted. This can be used to handle the rare case where you have an escape sequence with a trailing # which must be followed by a digit. eg. \v10 implies track variable 10. \v1\b0 implies track variable 1 followed by a 0
Field Values
\{fldname}Insert Yate Initial Fieldis used to insert the initial contents of the specified field within a file. Note that an initial field is defined as the value of a field when the file was first loaded or since last saved. If you depress the Shift while selecting an item on the Insert Yate Initial Field context menu, you will get the raw field name without the escape characters. If the Shift key is depressed prior to displaying the context menu, all fields will be displayed as opposed to those with a value.
\{<varname]Initial Value of Field in Named Variablethe specified named variable contains the name of the field whose initial content's are to be inserted.
\+#Initial Value of Field in Track Variablethe specified track variable contains the name of the field whose initial content's are to be inserted. eg. if Variable 1 contains Artist, \+1 will be replaced with the initial contents of the Artist field
\RRating (0-5)insert the default rating as a value between 0 and 5. This is used to get an external facing value for the rating as opposed to its internal format
\[fldname]Insert Yate Fieldis used to insert the contents of the specified field within a file. eg. fldname can be Artist. If you depress the Shift key while selecting an item on the Insert Yate Field context menu, you will get the raw field name without the escape characters. If the Shift key is depressed prior to displaying the context menu, all fields will be displayed as opposed to those with a value.
\[<varname]Value of Field in Named Variablethe specified named variable contains the name of the field whose content's are to be inserted.
\=#Value of Field in Track Variablethe specified track variable contains the name of the field whose content's are to be inserted. eg. if Variable 1 contains Artist, \=1 will be replaced with the contents of the Artist field
IDs
\UUnique IDused to create a unique value as is generated by the Database ID action statement. If you are interested in the type of value generated see Preferences-Actions
\YAYate Album IDinsert the Yate Album ID
\YTYate Track IDinsert the Yate Track ID
\YIYate UIDinsert the Preferences-General Yate UID field
Miscellaneous
\?lcAPISEEDS Remaning CreditsThe total number of remaining APISEED credits or empty if the value is not available.
\!propname!Insert Yate File Propertyis used to insert the value of a property within a file named propname. The context menu Insert Yate File Property can be used to insert these sequences
Numeric Expressions
\x(expression\x.)Numeric Expressionexpression can be any expression as defined in the Evaluate Expression statement and may contain escape sequences. Note that the terminating sequence has a leading \ character. If the expression cannot be compiled a message will be posted and the action will be terminated at the start of the next statement or earlier. If the expression results in an invalid number or in the case of division by zero, nothing is inserted. If the expression evaluation works, the inserted text may or may not contain a fractional component.
\x(expression\x)Numeric Expression (integer)expression can be any expression as defined in the Evaluate Expression statement and may contain escape sequences. Note that the terminating sequence has a leading \ character. If the expression cannot be compiled a message will be posted and the action will be terminated at the start of the next statement or earlier. If the expression results in an invalid number or in the case of division by zero, nothing is inserted. If the expression evaluation works, the inserted text will always be an integer value.
UDTIs
\^UDTIname^User Defined Text Itemis used to insert the value of a UDTI. If the UDTI does not exist, nothing will be inserted. Note that due to the implementation, this sequence will work even if the UDTI is mapped to a custom field. The Insert Common UDTI context menu can be used to quickly insert common UDTI names
\^<varname^User Defined Text Item in Named Variablethe specified named variable contains the name of a UDTI whose content's are to be inserted. eg. if named variable udti contains MyData, \^<udti^ will be replaced with the contents of a UDTI named MyData. If the item does not exist, the sequence is ignored
\*#User Defined Text Item in Track Variablethe specified track variable contains the name a UDTI whose content's are to be inserted. eg. if Variable 1 contains MyData, \*1 will be replaced with the contents of a UDTI named MyData. If the item does not exist, the sequence is ignored
Variables
\<varname>Insert Named Variableinserts the contents of the named variable varname. If the named variable does not exist, it is considered to be empty. The context menu Insert Special Yate Named Variable can be used to insert special named variables set by the application. If you need the non escaped name of a special named variable, depress the Shift key when selecting the item. You would do this when an action statement requires the name as opposed to the contents of a named variable. The Insert Named Variable context menu contains all named variables directly referenced in text fields in all open actions. The Shift key functionality applies to this menu as well
\@#Named Variable in Track Variableinsert the contents of the named Variable whose name is contained in the specified track variable. eg. if Variable 1 contains test, @1 will be replaced with the contents of named variable test
\@<varname>Named Variable in Named Variablethe named variable varname contains the name of the named variable to be inserted
\V#Track Variableinsert the contents of the track variable
\I#Track Variable as Integerinsert the contents of the specified track variable as an integer value. The leading integer value in the track variable will be returned. If there is no leading integer value, 0 will be returned. eg. 5th movement --> 5
\F#Track Variable as Floatinsert the contents of the specified track variable as a numeric value. The leading number in the track variable will be returned with at least one non fractional digit and at least one fractional digit. If there is no leading number, 0.0 will be returned. eg. 22.52, text --> 22.52
\S#System Variableinsert the contents of the specified System Variable
Version Strings
\?IViTunes Version stringinsert the iTunes version string or ? if it is unavailable
\?OSMac OS Version stringinsert the Mac OS version string
\?MVMusic Version stringinsert the Music version string or ? if it is unavailable
\?TVTV Version stringinsert the TV version string or ? if it is unavailable
\?YVYate Version stringinsert the Yate version string
Other Sequences
\char where char is any character other than those defined above as following a \, will not be modified. eg. \z is equivalent to z. As additional escape sequences can be added at any time, this form is not recommended.


Submenus Available in Action Text Fields

Insert Yate Escape Sequence
This menu has items to insert all of the valid escape sequences. The menu contains grouping submenus.

Insert Yate Field
This menu inserts the escaped name of a Yate field. If the Shift key is pressed, the unescaped name will be inserted.

Insert Yate Initial Field
This menu inserts the escaped name of a Yate field when a file was first loaded or last saved. If the Shift key is pressed, the unescaped name will be inserted.

Insert Yate File Property
This menu can insert most of the properties available on the Get Property statement. The name of the property will be properly escaped. If you want the unescaped name, hold doen the Shift key when inserting.

Insert Special Yate Named Variable
This menu contains the names of all named variables directly set by Yate. ie. not user defined. This menu is contextually aware of the intent of a field. When inserting to a field which should contain the name of a named variable, the inserted contents will not be escaped. When the field specifies a value, the inserted contents will be escaped. You can flip the interpretation of the inserted contents while holding down the Shift key.

Insert Common UDTI
This menu contains the names of all UDTIs directly set by Yate. ie. not user defined. This menu is contextually aware of the intent of a field. When inserting to a field which should contain the name of a UDTI, the inserted contents will not be escaped. When the field specifies a value, the inserted contents will be escaped. You can flip the interpretation of the inserted contents while holding down the Shift key.

Insert Runtime Setting
This menu contains the names of all action run time settings which are referenced in any open action or are already defined. This menu is contextually aware of the intent of a field. When inserting to a field which should contain the name of an action runtime setting, the inserted contents will not be escaped. When the field specifies a value, the inserted contents will be escaped. You can flip the interpretation of the inserted contents while holding down the Shift key.

Insert Named Variable
This menu contains the names of all named variables which are used in any open action. This menu is contextually aware of the intent of a field. When inserting to a field which should contain the name of a named variable, the inserted contents will not be escaped. When the field specifies a value, the inserted contents will be escaped. You can flip the interpretation of the inserted contents while holding down the Shift key.