General
Appends text to a file of your choice. Creates the file if it doesn’t exist yet.
| Box Name | Type | Description |
|---|---|---|
| File Name | String | Name of the file. Accepts both relative and absolute path. |
| Text | String | Text to append to the file. |
Copies a specified file to a new destination.
Will not replace the file if one with the same name is already present.
| Box Name | Type | Description |
|---|---|---|
| File Path to Copy From | String | The file you wish to copy. Accepts both relative and absolute path. |
| File Path to Copy to | String | Where to copy the file. Accepts both relative and absolute path. |
Reads a single line of file of your choice and saves it into a variable.
| Box Name | Type | Description |
|---|---|---|
| File Name | String | Name of the file. Accepts both relative and absolute path. |
| Line | Line which should be read. | |
| Save Variable As | String | Variable name the string is saved as. |
Reads a random line from a file of your choice and saves it into a variable.
| Box Name | Type | Description |
|---|---|---|
| File Name | String | Name of the file. Accepts both relative and absolute path. |
| Save Variable As | String | Variable to save the random line as. |
| Save Variable As (Position) | String | Variable to save the position of the random line to. |
Reads every line from a file and saves them into a variable either as a string, or an array.
| Box Name | Type | Description |
|---|---|---|
| File Name | String | Name of the file. Accepts both relative and absolute path. |
| Type | String | Array: Creates an array where it enters each line separately. String: Full text will be added as a string. |
| Save Variable As | String | Variable name the response will be saved to. |
Reads a JSON file and saves the parsed result directly into a SAMMI variable.
| Box Name | Type | Description |
|---|---|---|
| File Name | String / File Select | JSON file to read. Accepts absolute paths or paths relative to the SAMMI folder. |
| Save Variable As | String | Variable name where the parsed JSON object or array will be saved. |
The file must contain valid JSON. If the JSON root is an object, SAMMI saves an object. If the JSON root is an array, SAMMI saves an array.
Example file:
{
"user": "Chrizzz",
"points": 150,
"roles": ["mod", "vip"]
}
If saved as jsonData, you can read values such as /$jsonData.user$/ or /$jsonData.roles[0]$/.
Checks if a file already exists in a specified path. SAMMI will return true if the file exists, and false if it doesn’t.
| Box Name | Type | Description |
|---|---|---|
| File Path | String | The file to check. Accepts both relative and absolute path. |
| Save Variable As | String | The variable name to save the return value as |
Checks if a folder already exists in a specified path. SAMMI will return true if the folder exists, and false if it doesn’t.
| Box Name | Type | Description |
|---|---|---|
| File Path | String | The folder to check. Accepts both relative and absolute paths. |
| Save Variable As | String | The variable name to save the return value as |
Creates a folder at the specified path.
| Box Name | Type | Description |
|---|---|---|
| Folder Path | String | Folder path to create. Accepts both relative and absolute paths. |
Examples:
| Folder Path | Result |
|---|---|
| exports | Creates an exports folder inside SAMMI’s working directory. |
| exports/screenshots | Creates a nested screenshots folder inside exports. |
| C:/SAMMI/Backups | Creates or reuses the absolute folder path C:/SAMMI/Backups. |
Gets file paths from a folder and saves them as an array.
| Box Name | Type | Description |
|---|---|---|
| Folder Path | Folder Select | Folder to get files from. |
| File Extensions | String | Optional comma-separated list of file extensions to include, for example txt,png,jpg. Leave empty to include all files. |
| Save Variable As | String | Variable name to save the resulting array. |
| Include Subfolders | Checkbox | If checked, SAMMI also get files from subfolders. |
Examples:
| Folder Path | File Extensions | Include Subfolders | Save Variable As | Saved Value Example |
|---|---|---|---|---|
| C:/SAMMI/quotes | txt | false | files | [C:/SAMMI/quotes/one.txt, C:/SAMMI/quotes/two.txt] |
| C:/SAMMI/media | png,jpg | true | images | [C:/SAMMI/media/a.png, C:/SAMMI/media/sub/b.jpg] |
| exports | false | allFiles | All files directly inside the exports folder. |
File extension examples:
| File Extensions | Description |
|---|---|
| txt | Only .txt files. |
| .txt, .png, .jpg | Only .txt, .png, and .jpg files. |
| All files. |
The returned array contains full file paths. You can use Array Get Value, Array Random, or Repeat to work with the files afterwards.
Gets information about a file and saves the selected value to a variable.
| Box Name | Type | Description |
|---|---|---|
| File Path | File Select | File to get information from. |
| Type | Dropdown | Information to retrieve from the file. |
| Save Variable As | String | Variable name to save the result. |
Example using C:/SAMMI/files/example.txt:
| Type | Save Variable As | Saved Value Example |
|---|---|---|
| File Name | fileName | example |
| File Extension | fileExt | .txt |
| Folder Path | folderPath | C:/SAMMI/files/ |
| File Size | fileSize | 1428 |
| Created Date | createdDate | 2026-05-08 13:42:10 |
| Modified Date | modifiedDate | 2026-05-08 14:05:31 |
| Duration | fileDuration | Duration returned by the SAMMI_V2.dll helper, if the file type supports it. |
Returned date and duration formats may depend on the system and the SAMMI_V2.dll helper used by the command.
Opens a folder in the operating system’s file explorer.
| Box Name | Type | Description |
|---|---|---|
| Folder Path | Folder Select | Folder to open. Can be an absolute path or a relative path inside the SAMMI folder. |
Examples:
| Folder Path | Result |
|---|---|
| C:/SAMMI/exports | Opens the exports folder in Windows Explorer |
| exports | Opens the exports folder relative to the SAMMI folder |
Notes:
- On Windows, SAMMI will open the folder using Explorer. On other platforms behavior may vary or be unsupported.
Compresses a folder (including its subfolders) into a single .zip archive.
| Box Name | Type | Description |
|---|---|---|
| Folder Name | Folder Select | The folder you want to compress. Accepts both an absolute path and a relative path inside the SAMMI folder. Supports dynamic paths via variables. |
| ZIP Name | File Select | Destination path of the archive to create. Accepts an absolute or relative path. If you omit the .zip extension, SAMMI adds it automatically. |
| Pause Button Execution | Checkbox | When checked, pauses the current button’s execution until the archive has finished being created. Leave unchecked to let the button keep running while the folder is zipped. |
Examples:
| Folder Name | ZIP Name | Result |
|---|---|---|
| c:/SAMMI/exports | c:/SAMMI/backups/exports | Zips the exports folder into c:/SAMMI/backups/exports.zip |
| exports | backups/exports.zip | Zips the exports folder (inside the SAMMI folder) into backups/exports.zip inside the SAMMI folder |
Notes:
- Relative paths are resolved inside the SAMMI installation folder. All paths are converted to lowercase and backslashes (
\) are converted to forward slashes (/). - If either box is left empty, the command does nothing.
- If the folder cannot be zipped (for example, the source folder does not exist or the target location is not writable), SAMMI shows an alert and the archive is not created.
Extracts the contents of a .zip archive into a target folder.
| Box Name | Type | Description |
|---|---|---|
| File Name | File Select | The .zip archive you want to extract. Accepts both an absolute path and a relative path inside the SAMMI folder. If you omit the .zip extension, SAMMI adds it automatically. Supports dynamic paths via variables. |
| Target Folder | Folder Select | The folder the archive is extracted into. Accepts an absolute or relative path. The folder is created if it does not already exist. |
| Pause Button Execution | Checkbox | When checked, pauses the current button’s execution until the archive has finished being extracted. Leave unchecked to let the button keep running while the files are extracted. |
Examples:
| File Name | Target Folder | Result |
|---|---|---|
| c:/SAMMI/backups/exports.zip | c:/SAMMI/exports | Extracts exports.zip into the c:/SAMMI/exports folder |
| backups/exports | restored | Extracts backups/exports.zip (inside the SAMMI folder) into the restored folder inside the SAMMI folder |
Notes:
- Relative paths are resolved inside the SAMMI installation folder. All paths are converted to lowercase and backslashes (
\) are converted to forward slashes (/). - If either box is left empty, the command does nothing.
- If the archive cannot be extracted (for example, the file does not exist or is not a valid ZIP archive), SAMMI shows an alert and nothing is extracted.
Deletes a file from a specified file path. The file path must begin with a lowercase drive letter, for example, c:\ instead of C:\.
| Box Name | Type | Description |
|---|---|---|
| File Path | String | File you wish to delete. Accepts both relative and absolute path. |
Returns the SHA1 hash of a file.
SHA1 hash is like a file’s digital signature. You can verify a file’s integrity by checking its hash value. If even one byte in the file changes (i.e. the file is modified in any way), its hash value will be different.
Very useful command to periodically detect any file changes.
| Box Name | Type | Description |
|---|---|---|
| Variable | String | Variable to save the SHA1 string in. |
| File Path | string | File name you wish to get SHA1 hash of. Accepts both relative and absolute path. |