Workbench Editing Macros? (TADS3)

I find myself typing this sequence over and over again…

    dobjFor() {
        action () {
            "";
        }
    }

Does anyone know if there is a Macro feature in Workbench such that I could assign as sequence like this to a Function key?

Thanks,

–Bob

I don’t think Workbench provides that out of the box, but it has a feature to invoke an external program and assign that program to a function key. This means in principle you could, on a keystroke, invoke a program (or possibly a .bat file that invokes the “clip” command) that stores a predefined sequence of characters in the clipboard, and then type ctrl-V to paste the sequence in your code.

You could even pass the current column number to that program (Workbench allows this) so that it can adapt the lengths of leading whitespace to the current indentation.

Obviously, this is all a bit of work if you need to write a custom program for this.

However, if your recurring need is only to type an action handler (without the verify, check, preCond handlers that typically go to the same dobjFor/iobjFor blocks), and if you only need to display some text in the action handler in your common case, then a much simpler solution is use the equivalent but shorter syntax:

actionDobjExamine = ""

actionDobjTake = ""

actionDobjDrop = ""

and so on for all text-only action handlers you want to add.

Finally, Workbench has a feature to invoke an external editor, which you could use to edit your code with an editor that provides the functionality you need.

I recommend Auto Hotkey. (You can google it.) It’s free, and does exatly what you’re looking for.