newfilenotify.ahk
A simple AutoHotKey script for monitoring folders for new files.
Overview
The newfilenotify.ahk script can monitor one or more folders at a set interval and notify you when a new file is detected. When a new file is detected in one of your monitored folders, a Windows notification is sent (tray tip balloon in older versions of Windows) with the path to the file included in the message. The time interval and paths/file patterns for checking are set in a config.ini file, however, a few defaults are included:
- Default interval is 5000 ms
- Default folder is “My Documents” (all files)
Installation
You can use the pre-built installer that will install the script and a copy of AutoHotKey into the Program Files (x86) directory.
Manual Installation
If you run into trouble with running the installer or the script (usually due to it being picked up by AV software), you can download and install a copy of AutoHotkey and download the scripts provided in this zip file instead.
To run the scripts, unpack them to a local directory and run the runscript.bat file.
Configuring
The script reads values from the config.ini in the %APPDATA%\newfilenotifier directory. You can access this INI file using the tray menu for the script (right-click on the icon in the tray to show the menu).
| Setting | Description |
|---|---|
| interval | The time interval, in milliseconds, between scans of the target folders. |
| pathstocheck | A pipe-delimited (“|”) list of paths to monitor for changes. The paths should include wildcard characters to specify what type of files to monitor (“*” for all files, “*.docx” for Word documents, etc.) |
A sample INI file might look like this:
- config.ini
[config] interval=60000 pathstocheck=\\network_share\dropbox\*.xlsx|c:\users\luc\newstuff\*
Development
Change Log
- Initial release — Luc Daigle 2021-12-26 19:30
Known Issues
- When opening a new file that happens to be a Microsoft Office document (or anything that produces a temporary “hidden” file when opened) from the tray menu, the temporary file will be picked up by the script and logged as a new file. If you try to open the temporary file in the New Files window, an error will result. — Luc Daigle 2021-12-26 19:33
Ideas for Future Releases
- Use sqlite3 database to store the file information and to do the comparisons. This could allow for much larger sets of files to be monitored (the current method of comparing files is crude and slow). See https://github.com/AHK-just-me/Class_SQLiteDB/tree/master/Sources_v1.1 for sqlite3.dll functionality in AHK. There is a large discussion thread on this script at https://www.autohotkey.com/boards/viewtopic.php?p=7639 — Luc Daigle 2021-12-26 19:50
