Method of getting file name and path when using ‘File Watcher’ trigger

When used with the 'File Watcher' trigger, the expression AMTrigger.Filename will populate itself with a file's path and file name that was added, modified or deleted (depending on the trigger properties). When this 'Folder Watcher' trigger is activated, it automatically passes the AMTrigger object to the task. It merely needs to be envoked by using %AMTrigger.FileName%.

Note: In order for the task to work properly, it needs to be executed using the 'File Watcher' trigger. Clicking the 'Run' button will not envoke the trigger, thus the task will not create the expression AMTrigger.FileName. Therefore, make sure to ADD a 'File Watcher' to this task under the 'Triggers' tab of the of the 'Managed Task Properties' window. Save the task and test it by dragging a file into the folder your 'File Watcher' trigger is monitoring. Three dialogs should appear, one after the other, with the file's full path, then just the file's name, and lastly the file's name without an extension.

Click here to view task