Jump to content

Adding today’s date?


Recommended Posts

I have this simple shell script which adds today’s date when I run it:

 

set the_date to do shell script "date \"+%y-%m-%d\""

 

My probem is being new and ignorant regarding workflows I do not know how to compose a workflow that will trigger this script.

 

Can anyone help please?

 

Cheers.

Link to comment

I have this simple shell script which adds today’s date when I run it:

 

set the_date to do shell script "date \"+%y-%m-%d\""

 

My probem is being new and ignorant regarding workflows I do not know how to compose a workflow that will trigger this script.

 

Can anyone help please?

 

Cheers.

 

How or where do you want to display or paste the date? I assume you're looking to display or include it somewhere else, but just in case you're simply looking to paste it to a document, take a look at Alfred's Clipboard dynamic snippets:

http://support.alfredapp.com/kb:using-dynamic-placeholders-in-snippets

 

You can include {date} in a format that suits you into a snippet to paste it :)

 

If you have a more complex use in mind, share a bit more details and no doubt fellow Alfred users will help you out.

Link to comment

Thanks for this. The actual scenario is that I want to paste the current date into the name field when I am saving anything, e.g a pdf, so I get the result “Name Date” and the dynamic snippet {date:short} does this in the format 16/12/2014. Is it possible for the format to be changed to 2014/12/16?

 

Many thanks for your help.

Link to comment

Thanks for this. The actual scenario is that I want to paste the current date into the name field when I am saving anything, e.g a pdf, so I get the result “Name Date” and the dynamic snippet {date:short} does this in the format 16/12/2014. Is it possible for the format to be changed to 2014/12/16?

 

Many thanks for your help.

 

Alfred uses the format set by your own OS X settings so launch System Preferences to Language & Region > Dates to set it how you'd prefer. This will however affect your date setting on your Mac generally, so make sure you're happy with that :)

Link to comment

Hmm, One way I can think of doing this with minimal effort:

 

Create a new blank workflow.

Add a Hotkey Trigger, and set the hotkey to whatever you want.

Add an Action "Run Script" leave everything default (/bin/bash) and paste the following in the Script area:

 

date "+%y-%m-%d"

 

Then drag a connector from the right edge of the Hotkey box to the Run Script box

 

Now, add an Output "Copy to Clipboard" and in the blank box put:

 

{query}

 

then select "Automatically paste to front most app"

 

Now, drag a connector from the Run Script box to the Copy to Clipboard box.

 

and save

 

NOW, when you hit your hotkey combo, the date in format {y-m-d} will be pasted wherever your cursor was last.

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...