Some functions take file paths as input. They can create new files, copy existing ones, or execute them, and the way paths are written determines where the files are stored or accessed
Path Conventions
If a function creates a file or accesses a file created during template interpretation, the path is expected to be relative to the attachments folder. To use an absolute location, the path must start with the prefix global://.
Examples:
$SaveImage(index, "inputImage_$(index)")Saves the image with the specified index into the Attachments folder, using the file name given in quotation marks.
$WriteFile("global://C:\Users\user\Documents\file.txt", This is my file.)Creates a file at the specified absolute path. The second parameter is the file content, written as text, and it can also include functions and variables.
If a function accesses a file that existed before template interpretation started, the path must be given as a global (full) path (without the global:// prefix) or as a path relative to the work folder.
There may be exceptions to this rule, so it is suggested that you see the description of each function that requires a path before it is used.
Special characters in the paths must be recognized as such so they can be interpreted correctly. For backslashes (\), there is a function $EscapeBackslashes. For other special characters, check how to format the text so that they can be interpreted correctly.
Attachments Folder
Functions that generate files create an attachment folder in the same directory as the report created from the specified templates. The folder's name is [NameOfReport]_Attachments. If the folder with that name already exists, a new folder will be created with the smallest possible number appended to its name.