CarlosNZ Posted January 20, 2013 Posted January 20, 2013 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. 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! ) 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. drking and mlgill 2
bwanamatt Posted January 21, 2013 Posted January 21, 2013 Do you know how to alter the behavior so that the selection is just copied to the clipboard (and not also pasted)?
CarlosNZ Posted January 21, 2013 Author Posted January 21, 2013 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:
bwanamatt Posted January 21, 2013 Posted January 21, 2013 Wow, not sure how I never noticed that option. Thanks!
fmr Posted January 22, 2013 Posted January 22, 2013 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.
CarlosNZ Posted January 23, 2013 Author Posted January 23, 2013 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.
CarlosNZ Posted January 23, 2013 Author Posted January 23, 2013 Don't panic! Andrew is on the case: http://www.alfredforum.com/index.php?/topic/337-copy-to-clipboard-output-copies-a-literal-query-when-there-is-no-input-accepted/ fmr 1
CarlosNZ Posted January 26, 2013 Author Posted January 26, 2013 Small update to allow you to suppress the auto-pasting of the selected date string. Just hold down the "option" key when selecting. (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.
CarlosNZ Posted January 28, 2013 Author Posted January 28, 2013 v 1.2 now available. Last time that it will overwrite the date_time storage file as it now uses the proper working directories. Plus, you can move it to where you like now via "timedate move" and get a nice GUI dialog courtesy of Applescript.
mhannemann Posted April 11, 2013 Posted April 11, 2013 Very nice, thank you! I love the built-in editing ability you have in there. CarlosNZ 1
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now