I have a folder of videos (Mac OSX Yosemite) for which I need to change the Created Date by adding 2180 days to the existing Created Date.
Using SetFile from Terminal I am able to manipulate the Created Date, for example I can set it as equivalent to the Modified Date of the same file:
SetFile -d "$(GetFileInfo -m /Users/myfilename.mov)" /Users/myfilename.mov
However, if I try to add the ‘Add 2180 days’ part it stops working:
SetFile -d "$(GetFileInfo -d /Users/myfilename.mov) +2180 days" /Users/myfilename.mov
I suspect it is an issue with bracket and speech marks but the following did not work either:
SetFile -d "$(GetFileInfo -d /Users/myfilename.mov +2180 days)" /Users/myfilename.mov
How exactly should I be incorporating the '+2180 days' into it?
Edi: Mark Setchell has a solution which works but I am keen to know if there is in fact a way to incorporate '+2180 days' into the GetFileInfo-based -d date variable.
I know this is an older thread, but I wanted to do something like this. The OP @MrDave is asking about adding via normal speech. This can be accomplished with AppleScript.
A bit verbose, but it works:
now from terminal run:
and here you can actually just drag the file from Finder onto the Terminal instead of typing the filename itself, then hit enter
That's a lot of fun for something apparently so simple!!!! I think this works, but test it out on some sample files. I left my debugging statements in, but you can safely remove all the
echo
statements.Save it as
ReDate
and make it executable (only necessary once) withand run it like this:
Sample run: