Closed boyland closed 4 years ago
I think you're forgetting that <<textbox>>
is not a container macro—i.e., it has no contents.
Well, that's why my macro is called <<textboxlink>>
and it is a container macro. A clunky name, but gets across the idea, I hope.
Ah, my mistake. I thought you wanted to modify <<textbox>>
itself.
There's already an add-on macro, <<textboxplus>>
, that's a containerized version of <<textbox>>
, which also doesn't drop the ability to forward as yours does.
<<textboxplus>>
I prefer modifications to core macros as add-ons, so I think we'll leave it as that.
Thanks. The add-on looks like exactly what I need. Is it obvious how to use an add-on? Or is it used the same way that I defined my custom-macro: copy JavaScript code into my story?
You copy the given JavaScript into the JavaScript section of your project. Add-ons generally come with documentation, instructions and usage, but <<textboxplus>>
was a quick Gist for a request.
I've found it limiting to have the only way to handle a CR on a textbox is to go to a new passage. I created my own version
<<textboxlink>>
that silently expands its payload when CR is pressed. I could do a pull-request, if you'd like. Otherwise, the only real difference is changingto
where
contents
is set tothis.payload[0].contents.trim()
in the outer scope.