And last but not least - final the best solution (in my eyes) which comes really in the near for what you looking for.
This command group contain a command which read the first joke which is stored in your text file. Then the command cut it out and place it at the end of the file. In this way you will never have a joke twice, unless you have all heard.
You can use my testjoke.txt file to have a first start (put it in the VC mainfolder). All jokes written in a line without a carriage return, only the last line has a carriage return, because I use the "file.AppendLine" action which insert a carriage return after insert the joke, which is important.
You must also enable in VC the DxInput plugin which allowed us keyboard inserts (that was the trick).
Note: If Notepad is not your default txt editor, remove the
Window.Focus action. (thanks to James for the hint)
Have fun and let me know how it works
<?xml version="1.0" encoding="utf-16"?>
<!--VoxCommando 1.9.2.2-->
<commandGroup open="True" name="final jokes command" enabled="True" prefix="" priority="0" requiredProcess="" description="">
<command id="321" name="read jokes without doubles" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
<action>
<cmdType>Launch.OpenFile</cmdType>
<params>
<param>{Path.VC}\testjoke.txt</param>
</params>
<cmdRepeat>1</cmdRepeat>
</action>
<action>
<cmdType>VC.Pause</cmdType>
<params>
<param>150</param>
</params>
<cmdRepeat>1</cmdRepeat>
</action>
<action>
<cmdType>Window.Focus</cmdType>
<params>
<param>notepad</param>
</params>
<cmdRepeat>1</cmdRepeat>
</action>
<action>
<cmdType>VC.Pause</cmdType>
<params>
<param>150</param>
</params>
<cmdRepeat>1</cmdRepeat>
</action>
<action>
<cmdType>DxInput.KeyDown</cmdType>
<params>
<param>shift</param>
</params>
<cmdRepeat>1</cmdRepeat>
</action>
<action>
<cmdType>VC.Pause</cmdType>
<params>
<param>50</param>
</params>
<cmdRepeat>1</cmdRepeat>
</action>
<action>
<cmdType>DxInput.KeyPress</cmdType>
<params>
<param>downarrow</param>
<param>leftarrow</param>
</params>
<cmdRepeat>1</cmdRepeat>
</action>
<action>
<cmdType>VC.Pause</cmdType>
<params>
<param>50</param>
</params>
<cmdRepeat>1</cmdRepeat>
</action>
<action>
<cmdType>DxInput.KeyUp</cmdType>
<params>
<param>shift</param>
</params>
<cmdRepeat>1</cmdRepeat>
</action>
<action>
<cmdType>VC.Pause</cmdType>
<params>
<param>50</param>
</params>
<cmdRepeat>1</cmdRepeat>
</action>
<action>
<cmdType>DxInput.KeyDown</cmdType>
<params>
<param>control</param>
</params>
<cmdRepeat>1</cmdRepeat>
</action>
<action>
<cmdType>DxInput.KeyPress</cmdType>
<params>
<param>x</param>
</params>
<cmdRepeat>1</cmdRepeat>
</action>
<action>
<cmdType>DxInput.KeyUp</cmdType>
<params>
<param>control</param>
</params>
<cmdRepeat>1</cmdRepeat>
</action>
<action>
<cmdType>DxInput.KeyPress</cmdType>
<params>
<param>delete</param>
</params>
<cmdRepeat>1</cmdRepeat>
</action>
<action>
<cmdType>VC.Pause</cmdType>
<params>
<param>50</param>
</params>
<cmdRepeat>1</cmdRepeat>
</action>
<action>
<cmdType>DxInput.KeyDown</cmdType>
<params>
<param>leftalt</param>
</params>
<cmdRepeat>1</cmdRepeat>
</action>
<action>
<cmdType>DxInput.KeyPress</cmdType>
<params>
<param>f4</param>
</params>
<cmdRepeat>1</cmdRepeat>
</action>
<action>
<cmdType>DxInput.KeyUp</cmdType>
<params>
<param>leftalt</param>
</params>
<cmdRepeat>1</cmdRepeat>
</action>
<action>
<cmdType>VC.Pause</cmdType>
<params>
<param>50</param>
</params>
<cmdRepeat>1</cmdRepeat>
</action>
<action>
<cmdType>DxInput.KeyPress</cmdType>
<params>
<param>return</param>
</params>
<cmdRepeat>1</cmdRepeat>
</action>
<action>
<cmdType>System.GetClipboardText</cmdType>
<params />
<cmdRepeat>1</cmdRepeat>
</action>
<action>
<cmdType>TTS.Speak</cmdType>
<params>
<param>{LastResult}</param>
</params>
<cmdRepeat>1</cmdRepeat>
</action>
<action>
<cmdType>File.AppendLine</cmdType>
<params>
<param>{Path.VC}\testjoke.txt</param>
<param>{LastResult}</param>
</params>
<cmdRepeat>1</cmdRepeat>
</action>
<action>
<cmdType>OSD.ShowText</cmdType>
<params>
<param>{LastResult}</param>
</params>
<cmdRepeat>1</cmdRepeat>
</action>
<phrase>tell me a joke, tell me an other joke, one more joke please</phrase>
</command>
</commandGroup>