pgaskin / NickelMenu

The easiest way to launch scripts, change settings, and run actions on Kobo e-readers.
https://pgaskin.net/NickelMenu
MIT License
591 stars 32 forks source link

Action output variables #106

Open pgaskin opened 3 years ago

pgaskin commented 3 years ago

I've been considering adding output variables to actions in the form of a string-to-string key/value mapping. This would be substituted in future commands, whose output would then be merged with the previous output.

Another three config items would be added: output_assign:<new_variable>:<old_variable> (for simplifying chains with actions which use the same variable names), output_check:<operator>:<variable>:<arg> (for setting success/failure based on an output variable), and output_unset:<variable>....

Output substitution would be based on (and share code with) #94, but with {{ as the placeholder. In addition, there would be a special output variable to return all output variables in a key-value format and/or JSON.

For compatibility, cmd_output and other commands which currently show a pop-up with the output will continue to do so while also setting an output variable.

Thoughts?