Hi -
I rename all picture and movie files taken via my iphone to something like YYYY-mm-dd_hh-MM-ss.* using:
$Exiftool -progress -recurse "-FileCreateDate<DateTimeOriginal" "-FileModifyDate<DateTimeOriginal" "-FileName<DateTimeOriginal" -d "%Y-%m-%d_%H-%M-%S%%-c.%%e" $FullPath -ext jpg -ext PNG -fixbase
Problem is that Apple has .aee files for edited files. If I use the command above it renames all files but then I lose the association to .aee files.
I tried to workaround the problem by creating a script that finds .aee files, and then the associated .jpg and .mov files, and then rename them all at once to match the new name.
This works OK but then I would like to pass that directory name to above command to rename remaining files. What happens is that, it adds a -1 to file names which are already renamed to above naming format.
For example:
img-1234.jpg, img-1234.mov, img-1234.aee are 3 files all belonging to the same instance. when I use my script I get 3 files:
2017-06-06_14-00-00.jpg
2017-06-06_14-00-00.mov
2017-06-06_14-00-00.aee
If I know run the command above, I get two additional files
2017-06-06_14-00-00-1.jpg
2017-06-06_14-00-00-1.mov
but of course no corresponding .aee.
Ideally, I don't want these additional files as they are already renamed.
I know this is a long shot but Exiftool is so versatile that I thought I would ask. Is there any way for me to tell it somehow not to touch files that are already matching the target naming convention when I specify a directory to process?
Perhaps you could move the "set of 3" processed files to a sub-folder, then exclude (-i or -ignore) the subfolder from processing?
... -i '/Users/currentuser/Desktop/parent/child' '/Users/currentuser/Desktop/parent'
Which would exclude the folder named "child" while recursively processing the top level folder named "parent" (and any other child folders not explicitly ignored).
You could first rename the aee files using DateTimeOriginal from the jpg files:
exiftool -progress -recurse -tagsfromfile %d%f.jpg "-FileCreateDate<DateTimeOriginal#" "-FileModifyDate<DateTimeOriginal#" "-FileName<DateTimeOriginal" -d "%Y-%m-%d_%H-%M-%S%%-c.%%e" $FullPath -ext aee
Here I have also disabled the conversion for the dates copied to other dates. Although in this case it isn't a problem, it could be if you changed the date/time formatting.
- Phil
Phil,
OK, first I did not realize that I could process .aae files similar to others.
You comment also made me realize that although my intention was to fix FileCreate date as well as rename, I did not mean to use the formatting for both, just for rename!
Thank you for warning!
The problem is that Apple creates these files for every time there is some edit. So possibilities are
1) .jpg & .aae
2) .jpg & .mov & .aae
3) .mov & .aae
So, I shot a slow motion and edited a file to come up with a solution.
If I just copytagsfrom %d%f.jpg, using DateTimeOriginal that leaves #3 out
If I also copytagsfrom %d%f.mov, using CreateTime that solves #3. I could not test #2 use case but I am assuming that this will work, b/c file would be renamed already at this point.
Thanks again!
You could try this:
exiftool -progress -recurse -tagsfromfile %d%f.mov "-FileCreateDate<CreateDate#" "-FileModifyDate< CreateDate#" "-FileName<CreateDate" -tagsfromfile %d%f.jpg "-FileCreateDate<DateTimeOriginal#" "-FileModifyDate<DateTimeOriginal#" "-FileName<DateTimeOriginal" -d "%Y-%m-%d_%H-%M-%S%%-c.%%e" $FullPath -ext aee
This command will take the information from the .jpg if it exists, otherwise from the .mov
- Phil
Exactly what I was looking for, thank you very much, Phil!
I came across this old discussion today. If I'm not mistaken, there's a significant typo that could cause confusion or errors.
The "AEE" sidecar files discussed herein are probably "AAE" sidecars. In other words, the second letter of the file extension should be an A, not an E.
Anyone looking back at this thread may want to keep this in mind, especially if copying the suggested code.
Could you post a .aae file (or email me one - philharvey66 at gmail.com) so I can have a sample?
- Phil
Sent you an example.
Thanks!
This file is PLIST format. I'll add read support for this.
- Phil