Jump to content
Allsop

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.

Share this post


Link to post

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.

Share this post


Link to post

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.

Share this post


Link to post

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 :)

Share this post


Link to post

...This will however affect your date setting on your Mac generally, so make sure you're happy with that :)

 

Ah…is there anyway to achieve the result I am looking for without changing these preferences?

Share this post


Link to post

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.

Share this post


Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...