Jump to content

New workflow - Time & Date Paste [updated to v1.2a]


Recommended Posts

Download. (Or get it in the AlfPT repository)

 

I was just noticing that Alfred 2's snippets allow for current {date} and {time} fields in the pasted output. Nifty, but I would have liked a little more control over the specific format. I was right on the verge of posting this as a feature request when I thought, hang on a sec, that would be really simple to whip up as a workflow. And so I did. :)

 

screenshot20130121at907.png

 

The default keyword is timedate, and the default hotkey is Ctrl-Shift-D. This brings up a list in Alfred's results with the current date and time presented in a variety of formats. Select one and it gets pasted to your frontmost app.

 

To customise the list of available formats, just enter timedate edit, and the text file will open for you to edit (with a syntax reference included).

 

Hope it proves useful to someone. :)

 

EDIT: Added screenshot.

 

----

 

Update: 27 January 2013

 

You can now hold down the "option" key when making a selection to suppress auto-pasting the output.

 

----

 

Update: 28 January 2013

 

  • Now uses recommended working directories for storing config info, so this is the last time an update will overwrite your time/date strings.
  • You can now select where the date/time strings file is stored (Hello Dropbox syncing! B) ) via a GUI dialog (via Applescript).

Update: 30 January 2013

 

  • Changed the bundleID and workflow name - I've deleted the old version from AlfPT and re-added as a new workflow.
Link to comment
Do you know how to alter the behavior so that the selection is just copied to the clipboard (and not also pasted)?

Yup, go the workflow panel, double-click on the "Copy to Clipboard" item, and deselect the "Automatically paste to front most app" option:

 

screenshot20130121at131.png

Link to comment

great.  but the paste also seems to to it's thing when you select edit - i.e.

 

then string {query} is pasted as the first word in _date_formats.txt when opened in textmate.  I haven't tried saving it, but I suspect the first entry would kinda weird.

Link to comment
great.  but the paste also seems to to it's thing when you select edit - i.e.

 

then string {query} is pasted as the first word in _date_formats.txt when opened in textmate.  I haven't tried saving it, but I suspect the first entry would kinda weird.

Yup, I noticed this too. I think this is an Alfred quirk, as the "Copy to clipboard" output is pasting a literal "{query}" string when there's no input. I'll make a note of it to Andrew.

 

Cheers.

Link to comment

Small update to allow you to suppress the auto-pasting of the selected date string. Just hold down the "option" key when selecting. B)

 

screenshot20130127at125.png

(NB: You could always swap the branches around so it worked the other way)

 

Note: Updating will overwrite your stored date/time strings, so copy-paste them somewhere else if you've made significant modifications to the default set. FYI, I'm going to release a version that will prevent this by using Alfred's recommended storage folders, and also allow you to choose where the file is stored (mine will be in my Dropbox, so it'll sync between all my computers), but this will probably actually be more work than the entire rest of the workflow so will have to wait a few days. :wacko:

Link to comment
  • 2 months later...

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