2023-06-28, 07:46
I'm trying to work out how I can dynamically change a context menu label but everything I come up with requires static values.
I even had a thought that I could just add context menus then control their visibility based on the output of a script but I don't see return values.
Ultimately, I would like to change the label of a context menu subitem based on the return value of an addon script.
At minimum control that context menu subitem visibility based on the return value of a script.
-----
example
<label>RunAddon(id[,opt])</label>
or
<visible>RunAddon(id[,opt])</visible>
The addon when ran would then be able to return a string for the label based on the current sys.listitem or at minimum return true or false if that menu item should be visible based on sys.listitem and sys.argv.
It feels like I am trying to do something that is not currently possible.
I even had a thought that I could just add context menus then control their visibility based on the output of a script but I don't see return values.
Ultimately, I would like to change the label of a context menu subitem based on the return value of an addon script.
At minimum control that context menu subitem visibility based on the return value of a script.
-----
example
<label>RunAddon(id[,opt])</label>
or
<visible>RunAddon(id[,opt])</visible>
The addon when ran would then be able to return a string for the label based on the current sys.listitem or at minimum return true or false if that menu item should be visible based on sys.listitem and sys.argv.
It feels like I am trying to do something that is not currently possible.