Jump to content

Add Date To Filename


Recommended Posts

It it possible to make this output the following format;

 

 

2013-03-25 08-46 PM
 
I'd like to insert "2013-03-25 08-46 PM" before the file name, I find it's better for sorting and finding files.
 
I tried it myself, but I failed as it was in Automator and I have no coding skills whatsoever (even though one might argue Automator doesn't require any.)
 
I have another extension I found from some one using bash to copy the date and time to the clipboard. I was able to modify that script for the above format. Since this is an automator action, I tried everything I could think of, I just fail in coding.
 
If not, no worries, right now I just manually replace the filename or I save it correctly at the time of creation. I also use the current date and time, not the created date.
 
Regardless, thanks, always appreciate new workflows.
Link to comment

Nice. Although I did modify the Automater workflow to use a YYYYMMDD format. I find this format much better for filenames.

 

Yes, I'd like to re-write so it takes options for the date/time format and insert location. Easier to re-write as a shell script I think if I want that.

Link to comment

It it possible to make this output the following format;

 

 

2013-03-25 08-46 PM
 
I'd like to insert "2013-03-25 08-46 PM" before the file name, I find it's better for sorting and finding files.
 
I tried it myself, but I failed as it was in Automator and I have no coding skills whatsoever (even though one might argue Automator doesn't require any.)
 
I have another extension I found from some one using bash to copy the date and time to the clipboard. I was able to modify that script for the above format. Since this is an automator action, I tried everything I could think of, I just fail in coding.
 
If not, no worries, right now I just manually replace the filename or I save it correctly at the time of creation. I also use the current date and time, not the created date.
 
Regardless, thanks, always appreciate new workflows.

 

Here you go: Add Date and Time Before Filename.alfredworkflow

 

Only tested briefly, so let me know if you have any issues.

Link to comment

@stouty The advantage of having YYYYMMDD at the end of the filename is a sort by name will also sort similar files by date. 

 

I'll change it so YYYYMMDD is the default. I've been working on a way for the user to choose from some defaults or add their own

Link to comment

@stouty The advantage of having YYYYMMDD at the end of the filename is a sort by name will also sort similar files by date. 

 

The original workflow used date created .. I actually meant the current timestamp. What do you think people would prefer?

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...