SAMMI Extensions
Folder Files
This extension allows you to scan a folder and manipulate files with lots of useful features.
Features
File and Folder Manipulation
- Scan all files in a folder and filter by extension, sort alphabetically, numerically, by date modified, or size.
- Retrieve a random file in a folder.
- Identify the last modified file in a folder.
- Get the size of a file.
- Rename, move, or delete a file (moved to the trash bin for safety).
- Create or delete a folder (moved to the trash bin for safety).
File Content Commands
- Read the last line of a file.
- Count lines in a file.
- Count files in a folder.
- Find specific strings in files.
Advanced Commands
- Compress and uncompress a folder.
- Get the duration of a media file (with or without FFmpeg).
Disclaimer
This extension provides optional functionality that can be utilized if you have FFmpeg installed on your system. FFmpeg is not distributed with this extension, nor is it required for the extension's primary functionality. You must download it separately from the official source: FFmpeg Essentials. Please familiarize yourself with FFmpeg's licensing terms and potential patent implications before use.
Setup
Old Version Warning
If you have the old version of this extension (Get Folder Files) installed, please completely uninstall it first by going to SAMMI Core -> Bridge -> Uninstall before installing this one. You will need to migrate all your existing buttons, as this extension has been completely overhauled.
- Install the extension. You can follow the Extension Install Guide.
- Make sure SAMMI is connected to Bridge. Bridge must be running at all times and be connected to SAMMI for Folder Files extension to work.
- Your basic setup is finished! The premade deck serves as an example of how to use the extension. It is recommended to create separate buttons in a different deck for custom commands to avoid overriding your buttons during future updates.
Administrator Permissions
If a command does not work as intended, try running SAMMI as administrator to avoid permission errors.
How to download and set up FFmpeg
The Get Media Length command works with both the native Windows method and FFmpeg. FFmpeg is more precise for some files, as the native Windows method rounds down to the nearest second.
If you wish to use FFmpeg for the Get Media Length command, click on the 'Set Up FFmpeg' button and follow the instructions.
Available Commands
Command Usage Reminder
These commands require a waiting period before 'Save Variable As' is populated. Use the Wait Until Variable Exists command, and remember to delete the variable you're waiting for beforehand.
Get Folder Files
Returns all files in a folder, with optional filters.
Box Name | Description |
---|---|
Folder Path | The path to the folder where the files are located |
File Extensions | Comma-separated list of file types to return. Leave empty to allow all |
Sort Order | Sort results alphabetically, by last modified date, or by size |
Save As Full Path | Save results as full path or just filenames |
Save Variable As | Variable name to save the file array |
Get a Random File
Picks a random file from a folder, with optional filters.
Box Name | Description |
---|---|
Folder Path | The path to the folder where the files are located |
File Extensions | Comma-separated list of file types to return. Leave empty to allow all |
Save As Full Path | Save result as full path or just filename |
Save Variable As | Variable name to save the random file name |
Get Last Modified File
Finds the most recently changed file in a folder, with optional filters.
Box Name | Description |
---|---|
Folder Path | The path to the folder where the files are located |
File Extensions | Comma-separated list of file types to return. Leave empty to allow all |
Save As Full Path | Save result as full path or just filename |
Save Variable As | Variable name to save the last modified file name |
Find String in Files
Finds specific strings (words) in files within a folder.
Box Name | Description |
---|---|
Folder Path | The path to the folder where the files are located |
File Extensions | Comma-separated list of file types to search. Leave empty to allow all |
String to Find | The word or phrase you're looking for |
Recursive Search | Search within subfolders (may take longer) |
Save Variable As (File) | Variable name to save the resulting filename |
Save Variable As (Line) | Variable name to save the line number where the string was found |
Get File Size
Returns the size of a file.
Box Name | Description |
---|---|
File Path | The path to the file |
Unit | Return size in KB or MB |
Save Variable As | Variable name to save the file size |
Count Files in a Folder
Counts the number of files in a folder, with optional filters.
Box Name | Description |
---|---|
Folder Path | The path to the folder where the files are located |
File Extensions | Comma-separated list of file types to count. Leave empty to count all |
Save Variable As | Variable name to save the file count |
Count Lines in a File
Counts the number of lines in a file.
Box Name | Description |
---|---|
File Path | The path to the file |
Save Variable As | Variable name to save the line count |
Read Line in a File
Reads a specific line or the last line in a file.
Box Name | Description |
---|---|
File Path | The path to the file |
Line Number | The line number to read |
Read Last Line | Option to read the last line |
Save Variable As | Variable name to save the result |
Create a Folder
Creates a new folder.
Box Name | Description |
---|---|
Folder Path | The path where the new folder will be created |
Move a File
Moves a file to another location.
Box Name | Description |
---|---|
Old File Path | The current path to the file |
New File Path | The new file path, including the filename and extension |
Rename a File
Renames a file.
Box Name | Description |
---|---|
File Path | The current file path |
New Name | The new name, including the file extension (e.g., .txt) |
Delete a File/Folder
Moves a file or folder to the recycle bin.
Box Name | Description |
---|---|
File/Folder Path | The path to the file or folder to delete |
Compress a File/Folder
Compresses (zips) a file or folder.
Box Name | Description |
---|---|
File/Folder Path | The path to the file or folder to compress |
Compressed File Path | The destination path for the compressed file |
Uncompress a File
Uncompresses (unzips) a file.
Box Name | Description |
---|---|
Compressed File Path | The path to the compressed file |
Uncompressed File Path | The destination path for the uncompressed file |
Get Media Length
Returns the duration of a media file. FFmpeg setup is required if "Use FFmpeg" is checked.
Box Name | Description |
---|---|
Media File Path | The path to the media file |
Unit | Choose between seconds, minutes, or hours |
Use FFmpeg | Check to use FFmpeg. Native method may round it down to the nearest second for some files. |
Save Variable As | Variable name to save the media length |
Get Help
Please see Troubleshooting for common extensions issues.