Alfred 2 Add To Temp workflow
Monday, August 15, 2016
As someone who surfs the net every single day, there will be times where I find something interesting and want to note it down. It usually comes in the form of a link. There are many apps out there that allows you to jot down random notes really quickly, but it still requires some mouse clicks or quite a few key strokes.
Simple note taking shortcut.With the help of Alfred* as a digital assistant, I can create small scripts that reduce the amount of actions required. I'm using the paid (powerpack) version in case you're curious.
*only for MacOS
The scripts are called "workflows" in Alfred, it's a relatively simple IFTTT (if this then that) kind of idea.
It follows the pattern of [keyword/trigger] > [action] > [result/output]
As you can see, it's really simple, and it's relatively easy to make your custom workflows too as long as you know a bit of bash, or python, etc.
"att" is just a keyword that I chose (add to temp) for appending any of my note to this temporary file; while "temp" is a keyword for opening/viewing the saved snippets. Words aren't as effective as a simple gif, so here.
![]() |
Native notification to show appended text! |
As you can see, it allows your snippet to be of any length, even multiline paragraphs works as expected. It is also tagged with Date/Time to make searching a little bit easier. On the topic of searching, I may add that feature to this workflow so that I can search through the notes from Alfred itself, though I'm pretty sure that the "find" function in Sublime Text will beat any kind of search algorithm I can come up with.
With this, I can add any note within 4 actions.
Copy text, open prompt, att, pasteSince I don't have a place to host the .workflow file, let me just share with you the secret sauce that makes all of this works. It's just a 1 line bash command. Formatting the date, time, then passing in the {argument} that Alfred receives then appending it all into a text file. That's it!
printf "$(date +%d-%m-%y) | $(date +%r)\n{query}\n\n" >> ~/Documents/scripts/temp.txt
Well, hope you guys like this little cheat that I've shared. I still haven't test it out in school yet but it has proven rather effective in normal use. Next post shall be on the text expander that I use to reduce the amount of repetitive typing I have to do, stay tuned!