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.
Sequence | Menu Item | Description |
---|---|---|
Action Sequences | ||
\#setting# | Insert Runtime Setting | is used to insert the value of an action runtime setting |
\#<varname> | Runtime Setting in Named Variable | the named variable specifies the name of an action runtime setting whose value is to be inserted |
\?rs | Action Runtime Setting Mapping | inserts the name of the runtime settings set associated with the runtime setting mapping. |
\a1 | Action Test State (0 or 1) | insert the value of the Action Test State as '0' for false and '1' for true. |
\a0 | Action Test State (empty or 1) | insert the value of the Action Test State as 'empty for false and '1' for true. |
\?ds | Action Debug State (0 or 1) | insert the value of the Action Debug State as '0' for false and '1' for true. |
\?nv | List of named variables | insert 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. |
\an | Name of Current Action | the name of the currently executing action, inline or not. |
\af | Name 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. |
\ai | Name of Initial Action | The name of the action initially started. |
\av | Version Number of Current Action | returns the version number on the executing action file's Version statement, if available. |
\a3 | Version Number of Initial Action | returns the version number on the initital action file's Version statement, if available. |
\at | Descriptive Text of Current Action | returns 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. |
\a2 | Descriptive Text of Initial Action | Same as \at but always returns the descriptive text of the initial action. |
\ad | Action Has Online Help | returns 1 if the executing action file has associated online help, otherwise 0. |
\p | Name of Calling Action | The name of the action which called the current executing action. This can return three possible forms:
|
\?ps | Prompt Status Text | The text issued by the last executed Prompt Status statement. |
Character Sequences | ||
\_ | Alternate Comma | insert an alternate comma (‚) character. In Involved People and Musician Credits fields, real comma characters should only be used as delimiters |
\\ | Backslash Character | the correct form to specify a single \ character |
\. | Centered Dot Character | inserts a centered dot character. This can be useful as a replacement character when debugging and looking for spaces in fields |
\?rx | Invalid Character Substitution Sequence | inserts the Settings - Rename Invalid character substitution field |
\, | List Column Delimiter | insert the default list column delimiter ➤ |
\~ | List Delimiter | insert the default list delimiter ⏎ |
\k | List Key-Value Delimiter | insert the default key-value delimiter ≔ |
\: | List Secondary Delimiter | insert a list secondary delimiter ● |
\m | Multi-Value Delimiter | insert the value of the multi-value delimiter |
\n | Newline character | insert a newline character |
\?xd | Non Standard Delimiters | inserts the non standard delimiters configured in Settings - Lists - Advanced Settings. |
\?ou | Open URL Statement Callback Marker | inserts the marker which is ● |
\?ri | Rename Template Token Indicator | Insert a ⇉ character which is the symbol used to indicate a token when extracting the contents of a rename template. |
\sp | Space character | insert a space character |
\- | Tab character | insert a tab character |
\&dddd | UTF16 Character | dddd 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 |
\?vn | Visual Newline Character | inserts the character Yate uses when it has to visually represent a newline character ↵ |
\?vt | Visual Tab Character | inserts the character Yate uses when it has to visually represent a tab character ⇥ |
Database Column Sequences | ||
\|column name| | Insert Column Value | this sequence is only valid while filtering a database. The column value in a row being filtered will be inserted. |
Date & Time Sequences | ||
\yy | Current Year | insert the year |
\t | Date & Time | insert the date and time as yyyy-mm-ddThh:mm:ss |
\d | Date | insert the date as yyyy-mm-dd |
\z | Date & Time.ms | insert the date and time as yyyy-mm-ddThh:mm:ss.### |
\%#D | Offset 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. |
\%#M | Offset 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. |
\%#m | Offset 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. |
\%#Y | Offset 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. |
\%#y | Offset 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 Interval | insert the time interval in ms since 1970-01-01T00:00:00 |
\y4 | Year Field as YYYY | insert 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 | ||
\L | Disable Escape Sequence Processing | No 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 |
\2 | Repeat Escape Processing | Strings 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. |
\b | Sequence Break | a 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 Field | is 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 Variable | the specified named variable contains the name of the field whose initial content's are to be inserted. |
\+# | Initial Value of Field in Track Variable | the 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 |
\r | Rating (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 Variable | the specified named variable contains the name of the field whose content's are to be inserted. |
\=# | Value of Field in Track Variable | the 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 | ||
\u | Unique ID | used 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 |
\ya | Yate Album ID | insert the Yate Album ID |
\yt | Yate Track ID | insert the Yate Track ID |
\yi | Yate UID | insert the Settings-General Yate UID field |
Miscellaneous | ||
\?fa | fanart.tv API Key is Set | Returns 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. |
\?fb | File Browser Display Status | Returns 1 if the File Browser is displayed, otherwise 0. This sequence is now deprecated. Use the same named Get Info function instead. |
\?ft | Finder Tags | The 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. |
\?lv | Log Viewer Content | The current content displayed in the Log Viewer. |
\?m3 | m3u File Encoding | ASCII, Latin-1 or UTF-8. This sequence is now deprecated. Use the same named Get Info function instead. |
\?om | Open Mode | Returns 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). |
\?pm | Preserve Mod Date when Saving | The value of the Audio - Settings - Preserve modification date/time when saving setting. Returns 1 for enabled, otherwise 0. |
\?lc | Remaining Lyrics Credits | This sequence is now deprecated. |
\sa | Selected Artwork Indicator | When 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 Property | is 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 Reference | dirpath 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 Expression | 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 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 | ||
\?as | Application Support Directory | insert the path to the ~/Library/Application Support directory |
\?ad | Default Album Database | Insert the path to the default album database optionally specified in Settings - Databases |
\?td | Default Track Database | Insert the path to the default track database optionally specified in Settings - Databases |
\?do | Documents Directory | insert the path to the Documents directory |
\?DL | Downloads Directory | insert the path to the Downloads directory |
\h | Home Directory | insert the path to the home directory |
\?mo | Movies Directory | insert the path to the Movies directory |
\?mu | Music Directory | insert the path to the Music directory | \yc | Path to Yate clip.mp3 | Many 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. |
\?ys | Yate Application Support Directory | insert the path to the ~/Library/Application Support/Yate directory |
UDTIs | ||
\^UDTIname^ | User Defined Text Info Item | is 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 Variable | the 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 Variable | the 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 |
\ci | Case Insensitive | \^ and \* escape sequences are treated as case insensitive. |
\cs | Case Sensitive | \^ and \* escape sequences are treated as case sensitive. This is the default. |
Variables | ||
\<varname> | Insert Named Variable | inserts 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 Variable | insert 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 Variable | the named variable varname contains the name of the named variable to be inserted |
\v# | Track Variable | insert the contents of the track variable |
\i# | Track Variable as Integer | insert 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 Float | insert 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 Variable | insert the contents of the specified System Variable |
Version Strings | ||
\?iv | iTunes Version string | insert the iTunes version string or ? if it is unavailable |
\?os | Mac OS Version string | insert the Mac OS version string |
\?mv | Music Version string | insert the Music version string or ? if it is unavailable |
\?tv | TV Version string | insert the TV version string or ? if it is unavailable |
\?yv | Yate Version string | insert 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. |