banditmr73 Posted May 20, 2016 Share Posted May 20, 2016 Is there a way to do math with the dates. I need a snip like this: date+10 = 30.05.2016 Link to comment
FroZen_X Posted May 20, 2016 Share Posted May 20, 2016 There is a workflow for this here: http://www.packal.org/workflow/date-calculator Simply type "dcalc today + 10d" into Alfred and it will show you the date. Press enter and it will be copied to your clipboard Link to comment
banditmr73 Posted May 20, 2016 Author Share Posted May 20, 2016 There is a workflow for this here: http://www.packal.org/workflow/date-calculator Simply type "dcalc today + 10d" into Alfred and it will show you the date. Press enter and it will be copied to your clipboard Thx but i want to use it as a snippets at alfred 3 Link to comment
buffaloseven Posted May 20, 2016 Share Posted May 20, 2016 (edited) Thx but i want to use it as a snippets at alfred 3 I don't think you can do calculations within a snippet, but you could use that workflow to calculate the date you want, and then create a snippet where the date is filled in using the {clipboard} placeholder. So your workflow could be... Use workflow above to trigger Alfred and calculate your date. Press enter to copy to clipboard. Then just type your shortcut and have it fill in the snippet with the date from the clipboard. This would be a better solution if you wanted the date embedded within a larger string. If you want to just paste in a date, you could use the date calculation workflow, set the format to the format you want to use, and then modify the workflow so that when the date is copied to the clipboard it's automatically pasted into the focused application. This would allow you to quickly insert the value into your documents. EDIT: If you're interested, I've made a modification to the Date Calculation workflow that will paste the result to the front-most application when you press enter on the result while holding the command key down. I can put it up for you to download if you'd like. Edited May 20, 2016 by buffaloseven Link to comment
banditmr73 Posted May 20, 2016 Author Share Posted May 20, 2016 I don't think you can do calculations within a snippet, but you could use that workflow to calculate the date you want, and then create a snippet where the date is filled in using the {clipboard} placeholder. So your workflow could be... Use workflow above to trigger Alfred and calculate your date. Press enter to copy to clipboard. Then just type your shortcut and have it fill in the snippet with the date from the clipboard. This would be a better solution if you wanted the date embedded within a larger string. If you want to just paste in a date, you could use the date calculation workflow, set the format to the format you want to use, and then modify the workflow so that when the date is copied to the clipboard it's automatically pasted into the focused application. This would allow you to quickly insert the value into your documents. EDIT: If you're interested, I've made a modification to the Date Calculation workflow that will paste the result to the front-most application when you press enter on the result while holding the command key down. I can put it up for you to download if you'd like. hello buffaloseven, i'am very interested about your modification workflow Link to comment
buffaloseven Posted May 20, 2016 Share Posted May 20, 2016 I've uploaded a release to a forked GitHub repository that can be found here: https://github.com/buffaloseven/Alfred-Workflows-DateCalculator/releases/tag/v2.4.1 I've made a pull request to the author's repository to hopefully get this minor tweak integrated into his official version. If you're familiar with modifying workflows, you'll be able to see the simple change I made to make it work. Enjoy :-) Link to comment
deadlyhifi Posted May 20, 2016 Share Posted May 20, 2016 (edited) I'm interested in this as well. I currently use textexpander but figure one app to rule them would be better - however, simple calculations and placeholders are required for me to replace TE. I certainly appreciate your efforts banditmr73, I'd just like to see this functionality build into the snippets. Edit: Just seen this, http://www.alfredforum.com/topic/8883-import-textexpander-snippets-into-alfred-v3/. I guess it's a while off replacing TE for me. Edited May 20, 2016 by deadlyhifi Link to comment
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