This is an old revision of the document!
Directory Watcher
Watchers are a powerful tool to automate your workflow,
Watcher Files
Watcher files are stored as a XML within your PCs AppData folder, it is possible to create remove and edit these files directly. This can even be done through external scripting tools to automate the process of creating watchers themselves
the AppData folder is hidden by default on most windows systems and can be found [path to appdata]
[file structure]
Creating a Watcher
Watchers can be created through the sift command line through the -CreateWatcher command
-CreateWatcher name - This is the name used to reference the directory watcher, it will be the name of the xml file directory - this is the directory that will be watched, this can be passed more than once to watch multiple directories script - this is a script to be executed upon triggering the watcher, the script can be a .v3s pipeline or a .bat script in the case of a .bat script the first line of the script must be ##SIFT (This ensures only scripts fully intended for sift are executed), the script command can be passed multiple times to execute multiple scripts, the scripts will be executed in the order they are passed. Recursive - if this is passed all sub-directories within a watched directory will also be watched. delay - a delay is important, as if you were to move several file into a watcher directory at once, a trigger would be made for each file. The delay is the number of ms to wait from trigger to execution, the delay will be reset with each new file, ensuring that everything is only triggered once. ALternativly you could set a large delay if you want things to run a certain time after you're done working. overwrite - if this watcher will overwrite any existing watchers with the same name, otherwise the command will fail
-listwatchers This command will list all watchers and their parameters
-deleteWatcher “name” use this command and pass the name of a watcher to delete it.
Using Watcher
For watchers to work Sift must be running in the background, from the system tray, to launch Sift in background mode you can either pass the command -LaunchMinimized, which will set Sift to always launch in the background, or -LaunchBackgroundInstance which will immediatly launch Sift to the background with out setting it to do so by default.
once sift is running in the background you can interact with it via the system tray icon
from here you can
open gui - this will open a standard instance of sift with a GUI open console - this will open a console instance of sift, only one console instance of sift can run at a time quit - this will close the background instance of sift, all other instances will remain open Disable start in tray - If you have sift set to launch in the background by default, this will disable it Watchers - if you have any active watchers they will be found here, within this list you can enable or disable individual watchers or enable or disable all watchers
when a watcher is triggered all v3d pipelines will be run in the background, however all .bat scripts will open a commandline interface, if you are running sift commands a command line instance of sift will open, this will not work if you already have sift open on the console, or if a script is triggered while another is still be processed.
[batch example]