[Python] get currently edited parameter

Similarly to ui.rolloverPar get the currently edited parameter.
It would also be amazing if we could get the current string as it’s being typed in a parameter’s value box!
Reason: building my own toolbox, hotstrings, shortcuts

1 Like

Perhaps unrelated, but just a reminder about:

me.curPar
The parameter currently being evaluated. Can be used in a parameter expression to reference itself.

If that can be used in your tool

Hi @rob

Thanks for the suggestion, to provide some more info:

I implemented hotstrings for my commonly used expressions so that I don’t have to type them every time.
If I type #AT, and have my mouse over the parameter textbox I’m typing into, then hit enter it replaces #AT with absTime.seconds. But this only works if my mouse is over that parameter (by monitoring ui.rolloverPar), hence my request. The currently edited parameter should be in the ui class most probably also.

Furthermore to make this “realtime” as in I’d prefer not to confirm by hitting enter but for the string replacement to happen immediately as I type the abbreviation, it would be great to get a callback function of some sort when a new character is typed, or similar.

This is just one use-case I’m sure there would be others.

+1 for most recently set parameter… since rolling over a par tells you when it was last set and by what function, I’d imagine somewhere this info is being stored already, and getting dependable access to that stack would be nice

1 Like