Jump to content

Date snippet


JuhaT

Recommended Posts

Hello,

Is it possible to have special date snippet other than default?

By default if I put {date}, I will get "27 Jan 2015", but what if I want is "yyyy_mm_dd" so basically current date in this way "2015_01_27"???

Or is it possible to create workflow to make new folder with current date using same naming style on Finder?

Thanks!

Link to comment

Thanks again RogerWW. Y works just fine!

 

Strange thing is, after running that workflow it will hit enter automatically. So basically it will return:

2015_01_27


I was looking to use this workflow for naming daily folders, but now it will add unnecessary (and un supported character) for folder naming. It's easily removable so not too big issue, but would be great if it would be one click solution. This also might be how Alfred snippet will work...
 
 
Thanks
Edited by JuhaT
Link to comment

 

Thanks again RogerWW. Y works just fine!

 

Strange thing is, after running that workflow it will hit enter automatically. So basically it will return:

2015_01_27


I was looking to use this workflow for naming daily folders, but now it will add unnecessary (and un supported character) for folder naming. It's easily removable so not too big issue, but would be great if it would be one click solution. This also might be how Alfred snippet will work...
 
 
Thanks

 

 

Well, I was pointing to the other workflow simply as an example of how the date could be changed easily using the modifiers of the date command.

You will need another workflow for making the folder with a property specified ... ie:

tell application "Finder"
make new folder with properties {name:do shell script "date +%Y_%m_%d"}
end tell

This applescript will make a new folder on the desktop named "2015_01_27"

 

For the life of me I am having a hard time remembering how to grab the front (or currently active) Finder window.

 

EDIT: ok you could try this in a new workflow:

tell application "Finder"
make new folder with properties {name:do shell script "date +%Y_%m_%d"} at (the target of the front window) as alias
end tell

Again, this is applescript, so make a new workflow like Keyword to Script, set your preferred keyword, and add the above as applescript (osascript) into the script box.

Edited by RodgerWW
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...