This project makes it possible to automatically prefix filenames with the creation date of the file on Mac OSX. For example: myfile.txt
becomes 2018-01-05 myfile.txt
.
It's made up of a Ruby script (bin/datestamp
) which is called from an Automator workflow which can, in turn, be triggered by a keyboard shortcut.
For example:
$ ln -s ~/Code/floehopper/datestamp/bin/datestamp ~/bin/datestamp
For example:
$ cp -R Datestamp.workflow ~/Library/Services/
For example:
$ open ~/Library/Services/Datestamp.workflow
And follow the GUI instructions.
The following adds the keyboard shortcut ⌘d to run the Datestamp service:
$ defaults write com.apple.finder NSUserKeyEquivalents '{ Datestamp = "@d"; }'
The Ruby script currently depends on Ruby v2.5.0 provided by rbenv
, because Pathname#birthtime
is a recent addition to Ruby.
The whole project has only been tested on Mac OSX Sierra (v10.12.6).
You may use, copy and redistribute this library under the MIT license.
© Copyright James Mead 2018