I’ve been asked to post the Keyboard Maestro macro I use, and had to recreate it.
Here is my use case. As many of you know, I have an ambitious Tinderbox to web publishing project, but this is for a Tinderbox file that never leaves my machine. In any case, it involves a file URL that doesn’t export nicely and wouldn’t mean much if we refactored it.
This requires Tinderbox, Bookends, BBedit and Keyboard Maestro. I have TBx 5.12.1, BE 12.0.3, BBe 10.5.5 and KM 6.1 at this writing.
In Bookends, I set my markers as | because my markup strategy uses those. You set this in Preferences>Scan & Bib where I also specify Author, Date, Unique ID. That means that when I drag a reference to the text in a TBx note, I get something like this:
|Goranson and Cardier, 2013, #63754|
Which literally was created by dragging. Note, this is not the option-drag that gives you a full bibliographic reference based on the style you have selected. You can do this without any other work. The example below uses APA 6th Ed.
Goranson, H. T., & Cardier, B. (2013). A Two-sorted Logic for Structurally Modeling Systems. Progress in Biophysics and Molecular Biology, 864. doi:10.1016/j.pbiomolbio.2013.03.015
Now you have the nice marker in your note. These are designed to be used by Bookends in scanning your document to build a bibliography, but we will do something different.
In BBedit, create two textfactory documents, both GREP-based find and replace. Keyboard Maestro will send clipped text to these and get transformed results back.
Below, I will give images of the three essential scripts. How this works, is you drag the Bookends record to the note and get the |delimited| reference. Select that and trigger the KM macro. You will end up with this: (Goranson and Cardier, 2013) and the entire thing is linked to Bookends. Clicking it opens Bookends and takes you to the entry. From there it is a snap to open the PDF if you have it. Bookends is where I keep all the technical papers I keep.
As it happens, the text engine in TBx 5 has quirks. I suggest you save your note after each use of the macro. If you have troubles, temporarily place the |marker| at the beginning of a (non-indented) line.
Feel free to message me privately if your question is not of interest to everyone here.
Hope these image links work
https://www.dropbox.com/s/fz9cqga2n4781ll/KM.jpghttps://www.dropbox.com/s/dxabdevax2xivh9/BBe1.jpghttps://www.dropbox.com/s/b05ag5wqqnqoto7/BBe2.jpg