For quick prototyping, it may be useful to generate this list of phrases without needing to edit and save the command each time.
This command can be used (separate from the command you actually want to use those phrases for) to generate a list, either in the log on the main window, to a file, or directly to the clipboard for pasting, based on what you type into the dialog box that pops up when the command is executed (the contents are also remembered for the duration of the session, so you can make changes without having to re-type or paste):
[output;extract] phrases [;to file;to clipboard]
Get Text Input [phrasesToExtract]
Inline C# Function: Extract Phrases, wait until execution finishes
Begin Text Compare : [~extractedPhrases] Has Been Set
Begin Text Compare : [{CMD}] Contains 'file'
Write (overwrite), '{TXT:~extractedPhrases}' to file '%USERPROFILE%\Desktop\extractedPhrases.txt'
Else
Set Windows clipboard to '{TXT:~extractedPhrases}'
End Condition
End Condition
(note that the path to the file is valid in most cases, but if you have moved the Desktop folder you'll want to adjust for that)
Where "Extract Phrases" contains:
using System;
public class VAInline
{
public void main()
{
string phrases = VA.GetText("phrasesToExtract"); // Retrieve what was entered into the popup dialog box
try
{
string[] extractedPhrases = VA.Utility.ExtractPhrases(phrases); // Extract all 'When I Say' phrase combinations
VA.WriteToLog(extractedPhrases.Length + " phrases extracted from '" + phrases + "'", "pink"); // Output info to event log
if (VA.Command.Action() == "Spoken" && !VA.Command.Name().EndsWith("phrases"))
{
VA.SetText("~extractedPhrases", String.Join("\r\n", extractedPhrases));
}
else
{
foreach (string p in extractedPhrases) // Loop through each phrase in extractedPhrases
{
VA.WriteToLog(p, "gray"); // Output info to event log
}
}
}
catch(Exception ex)
{
VA.WriteToLog("Extracting phrases failed: " + ex.Message, "red");
if (ex.Message.Contains("Memory"))
{
VA.WriteToLog("The system ran out of memory trying to extrapolate all phrases;");
VA.WriteToLog("Try reducing the number of phrase variations");
}
}
}
}