UserText change via button?

image

I share a template so we start with the same setup. The template controller has his initials in as the “drafter.” My intent is to create a button that would change it to my initials. After doing some research here I got my buton set up as far as:
_SetDocumentUserText
_drafter

but I can’t figure out how to have it drop my name or initials into it. I tried all the variants I could think of, but other than leaving the button with only those two lines & manually entering the text, I am stumped. What did I miss?

Thanks-
OB

Hello - use

! SetDocumentUserText
Drafter
Mosher

Both the key and the value are just plain text. For more than one word, put the text “inside double quotes” so the spaces will not kill the macro.

-Pascal

A tool button macro is the same as typing the command sequence.
If you type the sequence you want and it works that’s what your macro should be.

Starting your macro with “!” will cancel any running command
Preceding your command name with “_” tells Rhino to run the English version of the command.
Preceding the command with “-” runs the command line “scriptable” version of the command.

So, your macro should be:
!SetDocumentUserText
Drafter
Mosher

You don’t need the “_-” because you’re in English and the command doesn’t use a dialog.

Here’s a link to the Help for scripting:
https://docs.mcneel.com/rhino/6/help/en-us/index.htm#information/rhinoscripting.htm

Thank you both Pascal & John!

John - I very much appreciate your explanation of things - I’m groping most of the time. Now I have something to grab on to.