raguay.customct Posted December 6, 2015 Share Posted December 6, 2015 (edited) Quiver Workflow This workflow allows you to create templates with Handlebar syntax inside of the Quiver program. To use the workflow, you have to have Node.js installed first. I recommend using [Homebrew](http://brew.io) to install it. You need to make sure you have Node.js 6.0+ on your system. As of this update, I am using node.js 6.6. With the node program installed, set the environment variable nodeProg to the right to the directory path of the program. If you used HomeBrew, it should be "/usr/local/bin/node". Once Node.js is installed, go to your Quiver Library file in Alfred Browser and select the “Set Quiver Library” file action. This tells the workflow where your templates (or snippets) are to be kept. Create a workbook called “Snippets” with one note called Defaults. The Defaults note has to have one code block set to JSON and the defaults for the Handlebar expansions set. The rest of the notes will be templates. When you run “qt”, it will list all of your snippet in the Snippets notebook. When you select one, it will be expanded with any json cell the note and the Defaults json note data. There are several special helper function for Handlebars defined. They are: {{userfillin <text>}} The user will be asked for the value of the text to be inserted at that point in the snippet. This gives a way to add text to a snippet upon expansion. {{clip <num>}} This command will get the specified clipboard entry and put it in it's place. The <num> starts at 0 for the previous clipboard. The environment variable clipHist defined to the right will determine how far back in history of the clipboard will be retrieved. The larger the number, the slower the program is running. {{env <variable name>}} This command will get the environment varable specified and put it in it's place. Therefore, the macro {{env "alfred_workflow_data"}} will put the contents of the alfred_workflow_data environment variable in it's place. {{save <name> <text>}} This command creates a helper named “<name>” with the expanding text of “<text>”. It also places the given “<text>” at the point of definition. This allows you to create text snippets on the fly inside the template. Very handy. {{clipboard}} This helper command places the current clipboard contents at the point in the template. {{date <format>}} This will format the current date and time as per the format string given. See the help document that is loaded upon initialization. {{date <date/time> <format>}} This takes the date/time string and formats it according to the format given. See the help document that is loaded upon initialization. {{copyclip <num>}} Inserts the copyclip <num> into the location of the macro. The following data expansions are defined as well: {{cDateMDY}} gives the current date in Month Day, 4-digit year format {{cDateDMY}} gives the current date in Day Month 4-digit Year format {{cDateDOWDMY}} gives the current date in Day of Week, Day Month 4-digit year format {{cDateDOWMDY}} gives the current date in Day of Week Month Day, 4-digit year format {{cDay}} gives the current date in Day format {{cMonth}} gives the current date in Month format {{cYear}} gives the current date in 4-digit year format {{cMonthShort}} gives the current date in Short Month name format {{cYearShort}} gives the current date in 2-digit year format {{cDOW}} gives the current date in Day of Week format {{cMDthYShort}} gives the current date in Month day 2-digit year format {{cMDthY}} gives the current date in Month Day 4-digit year format {{cHMSampm}} gives the current date in h:mm:ss a format {{cHMampm}} gives the current date in h:mm a format {{cHMS24}} gives the current date in H:mm:ss 24 hour format {{cHM24}} gives the current date in H:mm 24 hour format You can also specify an area to split up the expansion using the "%|% character. If the "%|" characters are in a clip, the first part is pasted directly while all the other parts are put into copy clips starting at 1. You can then paste each part by pasting the corresponding copy clip. This workflow has the feature to save and paste copy clips: clips of text. You assign each clip a name (ie: 1, 2, a, b, life, etc) when you save it. It is kept until you save on top of it again. You copy and paste using a hotkey (I use ctrl-c and ctrl-v). Version: 3.0 Date: 07/04/2017 Packal: http://www.packal.org/workflow/quiver-workflow Github: https://github.com/raguay/MyAlfred Edited July 4, 2017 by raguay.customct Link to comment
raguay.customct Posted December 7, 2015 Author Share Posted December 7, 2015 The Packal link is now available! They are adding scripting to the program in a future release. So, expect more addition then! Link to comment
raguay.customct Posted March 31, 2016 Author Share Posted March 31, 2016 Just made major revisions to this workflow. It now has help files in Quiver to explain how to use it. Please let me know if you run into any issues. Link to comment
kleerkoat Posted April 2, 2016 Share Posted April 2, 2016 having issues. none of my snippets are showing, i've set the library, i see the help files and snippets in quiver but the Alfred command seems to not be working. ty Link to comment
raguay.customct Posted April 3, 2016 Author Share Posted April 3, 2016 (edited) Can you please select the debug option on the script filter and post the output. That output will tell me whether or not this is a problem that I was somewhat wondering if it would happen. I think I know what the issue might be. I am compiling a Haskell program to get the different snippet names from the library. I have a large number of snippets and the interpreted version was too slow. I believe it isn't able to find the dynamic loading library files on a system without Haskell. I developed the program with the Haskell for Mac IDE, but I can't get it to produce a static link image. Working on it. Also, you might check to see if Alfred can see your node.js install. The ~/Library/Application Support/Alfred 2/workflows/com.customct.QuiverWF/node.txt should point to the program. Check to make sure it is. It good to know that someone else is trying the workflow! Thanks for the feedback. Edited April 3, 2016 by raguay.customct Link to comment
raguay.customct Posted April 4, 2016 Author Share Posted April 4, 2016 Okay. I was finally able to get it to statically link. Learned a lot about Haskell! Please download and try it again. Also, make sure node.js is installed on your system. Link to comment
raguay.customct Posted April 8, 2016 Author Share Posted April 8, 2016 I just did a major update to this action. The new features are: 1) Paste through Keyboard Maestro (expanding the %| cursor placement macro). 2) Added the next Handlebar helper for doing relative dates (see the new help file). 3) Added the ability to hook into the Handlebar template engine by adding a JavaScript cell in the Defaults notebook. Now you can add your own helper functions. (see the new help file and new defaults file for examples). You will need to redownload from Packal and reinstall the help files to get the new documentation. I'm having a lot of fun with this one and making many templates (over 100 now). Link to comment
jenz Posted August 13, 2016 Share Posted August 13, 2016 Thanks for sharing this workflow. The instructions are not clear to me, so I am having trouble getting this to work. What do you mean by, "Once Node.js is installed, go to your Quiver Library file in Alfred Browser and select the “Set Quiver Library” file action." I have Node.js installed, so I am specifically wondering about, "go to your Quiver Library file in Alfred Browser". I have no idea what this means. Would you please elaborate? Thank you, Jonathan Link to comment
raguay.customct Posted August 15, 2016 Author Share Posted August 15, 2016 (edited) Open Alfred and type ~. That will show the Alfred Browser window at your home directory. Go down the directory until you get to the Quiver library file. With that file highlighted, right arrow and select the action "Set Quiver Library". Edited August 15, 2016 by raguay.customct Link to comment
raguay.customct Posted July 4, 2017 Author Share Posted July 4, 2017 Just got a new version to upload. It should work on any system now. I had problems getting my Haskell program to statically compile. But, it is now. I've updated the one in Packal.org and GitHub. Please download and give it a try. Diegobit 1 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