More apps I use are allowing wikilinks and I’d like a universal way to quickly turn a phrase into one via [[double brackets]]. Ideally I could create something that mimics the way coding programs open and close brackets smartly, but that seems a distant and unlikely future, so how about a KM shortcut or TextExpander snippet I could devise that, (1) upon highlighting a word and (2) pressing a key command, (3) brackets would be put at either end?
I realize you have a solution, but posting yet another option just for awareness.
PopClip could be an avenue. There is a single brackets extension. I don’t see one for double. However, it’s not too hard to create your own extensions.
Posting this information here as it is not too hard to create new PopClip extensions. This is a good tool to have in the toolkit!
For that matter, while the following may introduce risk of your change being overwritten at some point, you could modify the existing brackets extension to use [[ instead of [
~/Library/Application Support/PopClip/Extensions
Show Package Contents for Brackets.popclipext
Edit the brackets-square.php file (any text editor)
From: echo ‘[‘.$input.’]’;
To: echo ‘[[‘.$input.’]]’;
If you go with @ryanjamurphy’s macro to handle multi-word links, I suggest you add an initial step that saves the current clipboard to a variable and then a final step that saves the contents of that variable back to the clipboard. That way, your clipboard comes out of the macro in the same state it was.
Or just Delete Current System Clipboard as the final step and the previous clipboard will be restored; no need to set a variable (but you may find you have to set a brief pause before deleting).
Yes, thank you! I had always been under the impression that if I wasn’t using KM’s Clipboard History Switcher, KM wouldn’t keep track of my clipboard history. Now I’ve learned that it does.