I would like to use command queues to enqueue multiple calls to the same command, but with different parameters. Command-shared variables seem like the perfect avenue for this; unfortunately, it seems that command-shared variables aren't propagated to commands that are enqueued. More broadly-scoped variables (e.g. global variables) don't work for this because only the last value assigned is kept (because every enqueued command refers to the same variable).
My use case is as follows: the command I want to enqueue is primarily a TTS routine, but it does some other things as well (e.g. writing the text being spoken out to a file so that it can be read by other programs for subtitling). I don't want to repeat this logic everywhere, so I'm putting the text to be spoken into a ~~text variable and executing the command directly.
The only way I was able to get this to work reliably was to stop the current TTS playback, pause briefly, and then speak the new message instead. This works as expected; however, I would like to be able to enqueue multiple different messages to be spoken (and written out to the file) one after another, in the correct order, without needing to worry about messages overlapping or canceling each other out. Command queues seem like the perfect way to accomplish this, except that I can't figure out how to pass the text to be spoken to the TTS routine.
Attached is a profile which demonstrates a (greatly simplified) version of what I'm referring to. It seems to me that upon executing the enqueue command, the ((print)) command should be called after one second, printing "Test A", and then one second later, printing "Test B". The timing works out as expected, but both times instead print "Not set".
Is this a missing feature, or is this intentional behavior? Is there a better way to accomplish this? Thanks in advance for your time.
EDIT by Pfeil: Implemented.