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

zach2741

macrumors newbie
Original poster
Mar 27, 2019
1
0
Hello,

I do photography and every time I have to import the photos from SD Card I sort it out according to year>>month based on the photos creation date. I know there is probably a way to automate this process through Automator but I am unsure of how to build the program.

I'd like an Automator service titled "Import Photos" and does the following for me:
(Would like it to be a right click function)

1. Ask me which files or folder I'd like to import
2. Import the files or contents of the folder into the "Pictures" directory
a. Sort the files based on creation date
b. Move the files into the approiate folders based on this format "Year>>Month"
c. If the folder is not there, create it​
3. Display a notification when the process is complete displaying the following info
a. Number of files moved
b. Number of folders created
c. The newly created file paths​
 
I guess just a plain Automator Drag'N'Drop Service won't work, but an AppleScript or a Shell script will. You could integrate it within an Automator Service to get the task done.

Coding something like this from scratch without third-party tools is possible, but what about using Exiftool not to reinvent the wheel? Exiftool primarily deals with metadata and is a great photographer's tool.
http://owl.phy.queensu.ca/~phil/exiftool/filename.html
6.
Code:
exiftool -r -d %Y/%m/%d/image_%H%M%S.%%e "-filename<filemodifydate" DIR
Recursively rename all images in 'DIR' and any contained subdirectories to the form 'image_HHMMSS.EXT' (where 'ext' is the original file extension), and move them into a new directory hierarchy based on date of file modification, with path names like '2006/03/27/image_105859.jpg'
It´s quite easy to modify the command to your needs and even embed it as a bash script into some Automator Service that is able to execute on selected files or something like that.
 
  • Like
Reactions: superscape
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.