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.

There are lots of Yate escape sequences. While there are context menus to insert the various sequences, it may be difficult to remember at some point what a displayed sequence is. If a field's context menu has an Escape Sequence Description... item, you can do the following. Position the cursor in the text field then select Escape Sequence Description... from the context menu. A summary of the first escape sequence which is at or after the cursor position will be displayed.

Note that unless otherwise mentioned, 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
\#<varname>Runtime Setting in Named Variablethe named variable specifies the name of an action runtime setting whose value is to be inserted
\?rsAction Runtime Setting Mappinginserts the name of the runtime settings set associated with the runtime setting mapping.
\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.
\?dsAction Debug State (0 or 1)insert the value of the Action Debug State as '0' for false and '1' for true.
\?nvList of named variablesinsert a list representing the names of all named variables. Note that named variables which have an empty value are not represented. The list items are delimited by the default list delimiter (\~). Use of this sequence is deprecated. Use Get Info - List of Named Variables instead.
\anName of Current Actionthe name of the currently executing action, inline or not.
\afName of Current Action (Non inline)if not executing an inline action this sequence is the same as \an. If an inline action is executing, this sequence will always return the name of the containing non inline action.
\aiName of Initial ActionThe name of the action initially started.
\avVersion Number of Current Actionreturns the version number on the executing action file's Version statement, if available.
\a3Version Number of Initial Actionreturns the version number on the initital action file's Version statement, if available.
\atDescriptive Text of Current Actionreturns the descriptive text of the action, if available. 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.
\a2Descriptive Text of Initial ActionSame as \at but always returns the descriptive text of the initial action.
\adAction Has Online Helpreturns 1 if the executing action file has associated online help, otherwise 0.
\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
\?psPrompt Status TextThe text issued by the last executed Prompt Status statement.
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
\?rxInvalid Character Substitution Sequenceinserts the Settings - Rename Invalid character substitution field
\,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 list secondary delimiter
\mMulti-Value Delimiterinsert the value of the multi-value delimiter
\nNewline characterinsert a newline character
\?xdNon Standard Delimitersinserts the non standard delimiters configured in Settings - Lists - Advanced Settings.
\?ouOpen URL Statement Callback Markerinserts the marker which is
\?riRename Template Token IndicatorInsert a ⇉ character which is the symbol used to indicate a token when extracting the contents of a rename template.
\spSpace characterinsert a space 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
\?vnVisual Newline Characterinserts the character Yate uses when it has to visually represent a newline character
\?vtVisual Tab Characterinserts the character Yate uses when it has to visually represent a tab character
Database Column Sequences
\|column name|Insert Column Valuethis sequence is only valid while filtering a database. The column value in a row being filtered will be inserted.
Date & Time Sequences
\yyCurrent Yearinsert the year
\tDate & Timeinsert the date and time as yyyy-mm-ddThh:mm:ss
\dDateinsert the date as yyyy-mm-dd
\zDate & Time.msinsert the date and time as yyyy-mm-ddThh:mm:ss.###
\%#DOffset Days before Current Date (YYYY-MM-DD)# is an optional positive integer value which represents the number of days before the current date. For example: \%32D will return 2016-05-03 if the current date is 2016-06-04. This sequence is case sensitive.
\%#MOffset Months before Current Month (YYYY-MM)Note that the M is case sensitive. # is an optional positive integer value which represents the number of months before the current month. Only the year and month components of the date are inserted. For example: \%10M will return 2015-08 if the current date is 2016-06. This sequence is case sensitive.
\%#mOffset Months before Current Month (YYYY-MM-DD)The same as \%#M with the exception that the current day is also inserted. For example: \%1m will return 2016-05-04 if the current date is 2016-06-04. This sequence is case sensitive.
\%#YOffset Years before Current Year (YYYY)Note that the Y is case sensitive. # is an optional positive integer value which represents the number of years before the current year. Only the year component of the date is inserted. For example: \%2Y will return 2019 if the current year is 2020. This sequence is case sensitive.
\%#yOffset Years before Current Year (YYYY-MM-DD)The same as \#Y with the exception that the current month and day are also inserted. For example: \%1y will return 2015-06-04 if the current date is 2016-06-04. This sequence is case sensitive.
\>Time Intervalinsert the time interval in ms since 1970-01-01T00:00:00
\y4Year Field as YYYYinsert the Year field reduced to 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
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 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.
\{fldname}Insert Yate Field (Initial Value)is 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 key while selecting an item on the Insert Yate Field (Initial Value) 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
\[<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 Settings-Actions
\yaYate Album IDinsert the Yate Album ID
\ytYate Track IDinsert the Yate Track ID
\yiYate UIDinsert the Settings-General Yate UID field
Miscellaneous
\?fafanart.tv API Key is SetReturns 1 if the fanart.tv API key has been set in Settings - Artwork - Searching, otherwise 0. This sequence is now deprecated. Use the same named Get Info function instead.
\?fbFile Browser Display StatusReturns 1 if the File Browser is displayed, otherwise 0. This sequence is now deprecated. Use the same named Get Info function instead.
\?ftFinder TagsThe Finder's list of tag colours delimited by the default list delimiter (\~). This sequence is now deprecated. Use Get Info - List of Finder Colour Tags instead.
\?lvLog Viewer ContentThe current content displayed in the Log Viewer.
\?m3m3u File EncodingASCII, Latin-1 or UTF-8. This sequence is now deprecated. Use the same named Get Info function instead.
\?omOpen ModeReturns the current open mode. This sequence is now deprecated. Use the same named Get Info function instead. The following characters are used to describe the current setting:
A (Album Mode)
P (Playlist Mode)
+ (add to the file list)
- (replace the file list)
S (process subfolders)
X (do not process subfolders).
\?pmPreserve Mod Date when SavingThe value of the Audio - Settings - Preserve modification date/time when saving setting. Returns 1 for enabled, otherwise 0.
\?lcRemaining Lyrics CreditsThis sequence is now deprecated.
\saSelected Artwork IndicatorWhen an action is started (not by the batch processor) and a full artwork panel is in the current edit panel and a single artwork item is selected, this sequence will return a value appropriate for an artwork statement's index field. When testing, an integer value of 0 or false implies that one of the required conditions are not met. More information can be found in the Accessing a Selected Artwork Item topic.
\!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 Exprs/Container Refs
\?[dirpath\?]Container Referencedirpath can be any directed path as described in Directed Paths and may contain escape sequences. Note that the terminating sequence has a leading \ character. This sequence is effectively an Extract Data from Container statement with the include data tag option not enabled. Errors are not reported. Any error will result in nothing being inserted and the error text will be in named variable Container Error.
\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.
Paths
\?asApplication Support Directoryinsert the path to the ~/Library/Application Support directory
\?adDefault Album DatabaseInsert the path to the default album database optionally specified in Settings - Databases
\?tdDefault Track DatabaseInsert the path to the default track database optionally specified in Settings - Databases
\?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
\ycPath to Yate clip.mp3Many actions require a stub audio file for various reasons. Yate itself requires these files and generates them when required. This sequence generates a stub file and inserts the full path to the file. The file is only generated if required (ie. if it does not already exist). The file can be moved, manipulated or deleted. The file is created at ~/Documents/Yate/Yate clip.mp3.
\?ysYate Application Support Directoryinsert the path to the ~/Library/Application Support/Yate directory
UDTIs
\^UDTIname^User Defined Text Info 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 Info 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 Info 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
\ciCase Insensitive\^ and \* escape sequences are treated as case insensitive.
\csCase Sensitive\^ and \* escape sequences are treated as case sensitive. This is the default.
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 Field (Initial Value)
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.

Insert Query Database Prefix
This menu contains the names of all referenced query database prefixes. This menu is only displayed where it is relevant.

Insert Container
This menu contains the names of all referenced containers. This menu is only displayed where it is relevant.