This task automatically copies camera photos from any storage device - for example a USB stick, a CD, a memory card or even a network drive - as soon as it is inserted or connected. All JPG files in a DCIM-folder in the main directory of the device are copied to a directory named after the current date and time. If no DCIM-folder exists the task will not perform any action.
What you need
- Retrieve newly added volumes and drives
- Retrieve folder contents
- Filter files and folders
- Search files and folders
- Retrieve current date and time
- Copy files and folders
Setting up the workflow
The task is to be executed as soon as at least one storage device has been inserted or connected. The "Retrieve newly added volumes and drives" action is used to determine which storage device this was. The prerequisite for this is that the task was started by the event "When volumes are inserted or drives are connected". Otherwise, the list returned by the action is empty.
After having determined the device one has to check if there is a DCIM-folder on it. In Task Till Dawn, storage devices can be handled like folders, in this case all files and folders in the main directory can be retrieved using the "Retrieve folder contents" action. I named the return variable "All files of the root directory". It is then filtered using the "Filter files and folders" action, leaving only the DCIM-folders, if any, which are stored in the "DCIM-folders" variable. These can then be searched for JPEG files using "Search files and folders" action. I have specified several file extensions as filters because they can be case-sensitive. You can add more file extensions to the list as you wish.
The last step is to copy these files to a target directory. To avoid chaos, a new folder with the current date and time should be created for each copy operation. To be able to do so, the "Retrieve current date and time" action is used to store the current date and time in a variable.
Now the copying process can be started. In the example, a folder on the local hard disk followed by the current date and time variable is specified as the target directory. The folder will be created automatically by Task Till Dawn, if it does not already exist.