Create an 'Alias' Macro (For Roam Research)

hi there,

i am trying to build a new macro here.
but its complexity excedes my KM skills !

when i have a word, say 'mouse',
i first highlight it,
then press the trigger for KM; let's say it's

the result would be this:
{{alias:[[ ]] mouse}}
while the cursor resting in between the square brackets

maybe a hint as to where to look in the archives would be super kool! because i dont know the KM terms we use for making the single steps work ...
i would be so grateful!

best wishes,


ok i found this:

so how can i move the cursor to rest between the double square brackets?

pls anyone?

EDIT: @mrpasini's suggestion immediately below is much better than this.


I think you'll need to get the character count of the system clipboard and then repeat the type a keystroke (left arrow) action that many times: see Peter's suggestion on getting the character count here - Determine string length.


{{alias:[[%|% ]] %SystemClipboard%}}

The %|% relocates the cursor.


Much better than my suggestion and now I've learned something!

1 Like

thanks so much y'all !!!
KM has superpowers.


1 Like

I wish I could find where %|% is documented (or even what it's officially called). I call it the text insertion point token but that doesn't return any results in the Wiki or manual when I search for it.

Look here for VBAR:


Thanks! What's the opposite of, "Of course!"

VBAR? (Vertical Bar: |) With a name like that you can't answer the question without already knowing the answer.

nice! a wiki, def will have a look :thinking:

FYI the search I did was for “position cursor”. Don’t ask me why!!

I added some tags to the wiki in the hopes of making this easier to find:

Tags: Cursor Location, Cursor Position, Text Substitution



Great. Thinking about it today (as a distraction, let's say) I thought this has less to do with the cursor (which may roam freely over the screen) than it has to do with the text insertion point (which is where you click before typing). I wouldn't look for "cursor" but I would look for "insertion point."

The text cursor long predates the mouse cursor, but I take your point.


1 Like

Take a look now.


Thanks. Even I can find it now!

1 Like