I've downloaded a bunch of my Instagram images but the Date Created of the files is set to the time that I initiated the download. What I do have though is the Date Created in the filename. What I want to do is take the date in the filename, which I've changed to YYYYMMDDhhmm, and set that as the creation date of each file.
I changed the date in the filename into the YYYYMMDDhhmm because this is the format that the touch -t
command likes. Now all I need is a way to take the first 12 characters of the filename, pass it to touch -t
as the date to touch the file with and follow that with the full filename.
I imagine this could be accomplished with a combination of Hazel and a shell/AppleScript so that the date could be passed on from each individual image.
Cheers for any help 🙂
Best Answer
So after some hunting I stumbled on this little AppleScript on Mac OS X Hints. Thanks Krioni! I'm sure with some tinkering I could modify it to work with my filenames, but I just batch edited the image filenames to fit in with the script.
It simply looks for the second text item of the filename in between underscores and uses that as the date. It then adds
"1000"
as the time to thetouch
command. Hopefully this will help someone else out there.The original thread can be found here.