Atlas Informatics

Placeholders and Replacers

Placeholders

Atlas software sometimes has input fields where you can use placeholders to become more flexible. These should always be enclosed in curly brackets, e.g. "{Name}". This means that this passage should be replaced by a value that is taken from the current context, for example the path or name of the file currently being processed. Special values for the names are:

  • {Now}: Takes the current date and time.
  • {NewGuid}: Creates a new GUID in lower case without braces, e.g. 82da49af-9b6f-49b1-9d92-6d9ef5dd3e25
  • {Random:10} resp. {Random:10,A-Za-z0-9_}: Produces a random string of length 10 using the given character ranges or without the characters with lower and uppercase letters
  • {AppTitle} inserts the application's name (without ".exe")

The fetched value can optionally be transformed by a cascade of formattings separated by '&'. The possible format strings are either a .NET format string or an additional Atlas defined extension. Example: "{NewGuid:ToLower&FirstCharToUpper}" will first make it lower case and then the first letter upper case [in older program versions only a single formatting is supported]. The possible formats depend on the type of the placeholder value.

If the fetched value is a String, the following formatting extensions can be applied [version dependent]:

  • ToUpper: All characters of the passage are changed to upper case
  • ToUpperInvariant: All characters of the passage are changed to upper case invariant
  • FirstCharToUpper: The first character of the passage is changed to upper case
  • FirstCharToUpperInvariant: The first character of the passage is changed to upper case
  • ToLower: All characters of the passage are changed to lower case
  • ToLowerInvariant: All characters of the passage are changed to lower case invariant
  • FirstCharToLower: The first character of the passage is changed to lower case
  • FirstCharToLowerInvariant: The first character of the passage is changed to lower case invariant
  • ToTitle: A passage like "niceDay" is extended in words to "Nice Day", the first character is made upper case.
  • ToHtml: A passage like "a>b" is escaped (special chars reformed) to "a>b" using WebUtility.HtmlEncode
  • FromHtml: A passage like "a>b" is unescaped back to "a>b" using WebUtility.HtmlDecode
  • ToUri: A passage like "My Webpage" is escaped (special chars reformed) to "My%20Webpage" using Uri.EscapeDataString
  • FromUri: A passage like "My%20Webpage" is unescaped back to "My Webpage" using Uri.UnescapeDataString
  • ToUrl: A passage like "My Webpage" is escaped (special chars reformed) to "My+Webpage" using WebUtility.UrlEncode
  • FromUrl: A passage like "My+Webpage" is unescaped back to "My Webpage" using WebUtility.UrlDecode
  • Quote: The passage is enclosed in quotes as needed for C#. For example '\' is doubled and special chars written as '\n' aso. This is commonly used for specifying arguments in a C# like syntax.
  • QuoteDos: The passage is enclosed in quotes, where quotes in the text are doubled. This is usually used for CSV values or arguments on the command line (e.g. command prompt).
  • ToBytes: An unsigned long number "123456789" will be reformatted as a byte designation, in this case "117.7 MB"
  • Left(x): First x characters
  • Mid(x, y): The y characters starting from character x (0 is first)
  • Right(x): Last x characters
  • Rest(x): The characters from character number x to the end (0 is first).

If a Date or Time value is inserted, it is often necessary to format it in different ways in different countries. Atlas Software knows all format specifiers that are specified here in the Microsoft .NET Framework. Additionally, Atlas defines more formats:

  • ShortDate: In the US this would be "09/30/17"
  • LongDate: In the US "Saturday, September 30, 2017"
  • ShortTime: In the US "12:34"
  • LongTime: Includes seconds, "12:34:56"
  • DateAndTime: Short date including the year combined with the time including seconds, in the US "09/30/2017 12:34:56"
  • ShortDateAndShortTime: Short versions, in the US "09/30/2017 12:34"
  • ShortDateAndLongTimeWithMs: Short versions, in the US "09/30/2017 12:34.567"
  • ShortDateAndLongTimeWithTicks: Short versions, in the US "09/30/2017 12:34.2747339"
  • RelShortDateAndShortTime: Includes a relative day name if available, eg. "Yesterday, 09/30/2017 12:34"
  • RelShortDateAndLongTime: Includes a relative day name if available, eg. "Tomorrow, 09/30/2017 12:34:56"
  • RelLongDateAndShortTime: Includes a relative day name if available, eg. "Yesterday, September 30, 2017 12:34"
  • RelLongDateAndLongTime: Includes a relative day name if available, eg. "Tomorrow, September 30, 2017 12:34:56"
  • ShortDateIfNotTodayAndShortTime: Same as 'ShortDateAndShortTime' but the date is omitted if it's today
  • IsoDate: 2017-09-23
  • IsoDateTime: 2017-09-23 12:34:56
  • IsoDateTimeFull: 2017-09-23 12:34:56.1234567
  • IsoDate&Left(4): 2017
  • IsoDate&Mid(5,2): 09
  • IsoDate&Right(2): 23
  • IsoDate&Rest(5): 09-23

If full Pathnames are to be formatted, these formats can be used to pick parts out of it:

  • Folder: The full path of the parent folder of the file or folder. Results in an empty string if applied to any root.
  • FolderOrRoot: The full path of the parent folder of the file or folder. If applied to any root (eg. "C:\") it returns the root instead of empty string ("C:\").
  • FolderName: The name of the parent folder without it's path
  • FileName: The file's name including extension but without folder path
  • PureName: The file's name without the last extension and without path
  • Extension: The last extension of the path name
  • BeforePureName: The file's name without the last two extensions and without path
  • BeforeExtension: The second last extension of the path name
  • Root: The root (eg. "C:\") or UNC root ("\\Device\Share")
  • UncRoot: The UNC path root to a given non-UNC path like "Y:\Folder\File". If the drive is not mapped in the UNC registry an empty string will result.

Integer values: Integer format strings for .NET. For example "{name:000}" would end up having two leading zeros.

Decimal value: Decimal format strings for .NET

Atlas TimeSpan: Additional Atlas format strings are "SecondPrecise", "MinutePrecise" and "MillisecondPrecise". Optional "+". The minimal and maximal values are converted to "Min" and "Max".

To find the corresponding .NET format documentation you can just google for "dataType.ToString(String) C#". Replace "dataType" by the word your are looking for.

The content inside the placeholder brackets is limited to 200 characters.

Replacers

Another format is the so called replacers, e.g. "{name:from->to}". It can only be applied to strings (or previously formatted date). This starts a replacement process that replaces every occurrence of 'from' in the text with 'to'.

As an example, let's take Multimedia Xpert. You could create an Output Specification for a conversion from H.264 to H.265 and add "{n:x264->x265&H.264->HEVC}" to the pattern of the output file. So every time you use this specification to convert a media file, the file name would be automatically converted as well.

Note that these notations grow over time, so you might need to update your Atlas software to the latest version.

Go to Homepage