Quote from: schmid_al on November 08, 2020, 12:33:26 PM
- Renaming: Rename all pictures from "Import Folder/Inbox" according to "DateTimeOriginal" (if exists), otherwise sort after "CreateDate" (if exists), otherwise sort after "FileModifyDate" --> is it possible to merge those commands in only one?:
From note 1 on the Tag Value docs (https://exiftool.org/exiftool_pod.html#TAG---VALUE):
Many tag values may be assigned in a single command. If two assignments affect the same tag, the latter takes precedence
So you can put all three into one command and the last valid option will be used
exiftool -r -d %Y-%m-%d_%H-%M-%S%%-c.%%le '-filename<filemodifydate' '-filename<createdate' '-filename<datetimeoriginal' -P Import\ Folder/Inbox/*Quote- Sorting in folders: Create folder in the structure of "<YYYY>/<MM>/<CAMERA-MODEL>" and sort pictures into those folders. If "Model" exists, use it, otherwise use "DeviceModelName"; again, priority 1 would be to use "DateTimeOriginal" for date, priority 2 would be "CreateDate", priority 3 would be "FileModifyDate"
Same thing applies. Additionally, you can put directory paths into the above
Filename rename. Because you want to have a date, then a tag, then a date for the filename, there is a bit of a problem with the
-d (dateFormat) option (https://exiftool.org/exiftool_pod.html#d-FMT--dateFormat), so you have to decide to use that before or after the tag that is in between. In this case, keeping it as the filename would be better. Then you can use the
DateFmt helper function (https://exiftool.org//exiftool_pod.html#Helper-functions) for the first timestamp.
I won't put it all together for you, but the basic idea would be
exiftool -r -d %Y-%m-%d_%H-%M-%S%%-c.%%le '-filename<${DateTimeOriginal;DateFmt("%Y/%m"}/${Model;s/ /-/g}/$DateTimeOriginal' -P Import\ Folder/Inbox/*You would also include your "Other" directory in the listing, before the others.
At this point, your command will be getting very, very long and harder to troubleshoot. Your best bet would be to create an args file (see
-@ (Argfile) option (https://exiftool.org/exiftool_pod.html#ARGFILE)). The important thing to remember about args files is that each argument must be on a separate line. While
-filename<${DateTimeOriginal;DateFmt("%Y/%m"}/${Model;s/ /-/g}/$DateTimeOriginal would be a single argument and on a single line, the date option is two arguments and would have to be
-d
%Y-%m-%d_%H-%M-%S%%-c.%%leQuoteBTW: I discovered that exiftool only sorts .LRV-files (GoPro Videos) from my Import Folder when I use "*" after the folder name ("Import\ Folder/Inbox/*" instead of just "Import\ Folder/Inbox/"). With jpg it works in any way.
This would be FAQ #16 (https://exiftool.org/faq.html#Q16). Add
-ext+ LRV to the command to process those files in addition to what it would normally process.