Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Caesar_091

macrumors 6502
Original poster
Jan 18, 2005
289
12
Italy
Hello,

I just finished exporting +83k photo from my wife's iPhone (since Image Capture app was failing importing all the photos in one single job because of some bad files I exported the photos into less than 10 sub-folders to avoid messing with duplicates).
Now I would like to:
1) move all the exported photos into a new archive where I'm used to keep a back-up of all our photos in folders organized by year and month (not Finder's the creation date of course but the year/month the photo was shoot). Is there any tested/safe automator script or any app that can halp me in doing this by reading the shooting date from the EXIF information?
2) How can I check for duplicates and eventually delete the identified redundant files? Any suggestion?

After moving to the new archive/location I will have to import all the photos to my wife Apple's Photo app Library to let her handle all her shoots... pray for me! o_O

TIA
 

r.harris1

macrumors 68020
Feb 20, 2012
2,191
12,631
Denver, Colorado, USA
I use Photo Mechanic to do that same sort of thing all the time. Some folks find there's a bit of learning curve with the interface, but really, it's super simple, super fast and works brilliantly 100% of the time for me. No prayers required, just cash.

Obviously, it may not make sense for using just once, though I think they have a trial. In any case, other asset management tools like Lightroom and Capture One can do this sort of thing too but there's some overhead there.

An automator script could definitely do it, but would require some thought on the file management side.

While Photo Mechanic is one option that works really well, there will be others who chime in with their ideas and favorites too. Bottom line is you should get some great options over the coming days. :)
 

Caesar_091

macrumors 6502
Original poster
Jan 18, 2005
289
12
Italy
Thanks for the reply! Photo Mechanic looks interesting but as you wrote for a "one time" task only seems too much.

@All Any additional suggestion?
 

chown33

Moderator
Staff member
Aug 9, 2009
10,780
8,506
A sea of green
You could try a Smart Folder.

Have it do a search based on the Content Creation Date, which should be when the photo was shot, and give a range of a year. Tell it where to search.

Then make a new folder with the year in its name.
Select and drag all the files from the Smart Folder to the folder named for the year.

Repeat for every year.

After you've got the files in the right folder by year, you can repeat the process with a range for each month of that year.

Yes, it's a tedious manual process. Yes, it could probably be automated, but testing and debugging an Automator process (or Shortcut) could take longer than doing it the tedious manual way.


In Terminal, the 'mdls' command can be used to view all the metadata for a file.

Type the word mdls followed by a single space. Then drag one JPEG image onto the Terminal window and release it (drag and drop). The Terminal window should expand to the full filename of that file. Then press Return in the Terminal window.

The output should be a number of items, possibly 20 or more.

The content creation date should be like this:
Code:
kMDItemContentCreationDate     = 2022-04-27 07:40:32 -0700
This can differ from the creation date of the file, which is this:
Code:
kMDItemFSCreationDate          = 2022-04-27 14:40:30 -0700
The FS abbreviation means File System here.

If there isn't any metadata other than kMDItemFS stuff, then you may not have Spotlight enabled for the files. Spotlight is the metadata database, so without it, you won't be able to use any photo metadata in any searches for those files.
 

chown33

Moderator
Staff member
Aug 9, 2009
10,780
8,506
A sea of green
Thanks for your reply, do you know if the same metadata does works for videos too?
I don't know. It may depend on the video's origin. You could try it on a couple of test videos.

A command to output any metadata attribute with the word "creation" in it would be:
Code:
mdls path/to/file | grep -i creation

The '|' symbol connects the output of the 'mdls' command to the input of the 'grep' command.
'grep' is the Unix command for finding patterns in text.
The '-i' option means "case-insensitive"; grep's default is case-sensitive.
The 'creation' is the case-insensitive pattern to find in the 'mdls' output text.

More info on 'grep', including why it has such a weird name:
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.