The problem I'm having is that the loop doesn't stop when it reaches the literal space character.
I have the following:
Set Text [Priority1] to ''
Set integer [TextPos] value to 0
Start Loop While : [{TXTSUBSTR:"{CMD}":TextPos:1}] Does Not Equal ' '
Set Text [Char] to '{TXTSUBSTR:"{CMD}":TextPos:1}'
Set Text [Priority1] to '{TXTCONCAT:Priority1:Char}'
Set integer [TextPos] to [TextPos] plus 1
End Loop
Write '[Purple] {TXT:Priority1}' to log
Note that I moved the incrementing of "TextPos" to the bottom, so the first character of the command name doesn't get cut off.
The above works fine on my machine. "New Command 1" produces "New", as expected
An alternative method to accomplish the same result:
Set Text [Priority1] to ''
Set integer [TextPos] value to 0
Start Loop While : [{TXTSUBSTR:"{CMD}":TextPos:1}] Does Not Equal ' '
Set integer [TextPos] to [TextPos] plus 1
End Loop
Set Text [Priority1] to '{TXTCONCAT:Priority1:"{TXTSUBSTR:"{CMD}":0:TextPos}"}'
Write '[Purple] {TXT:Priority1}' to log
Note that the "Use Nested Tokens" option need to be enabled for this, otherwise you need to use an intermediate text variable, as you've done with "Char".
If you don't need the contents of "Priority1" conserved, you can do away with the nested tokens and set it directly to "{TXTSUBSTR:"{CMD}":0:TextPos}".
EDIT: As an aside, unless you need a number that doesn't fall between -32,768 and 32,767, you can use the "Small Integer (Condition)" value rather than an "Integer"
how do I set a text variable to a NULL string '' instead of NOT SET?
NULL and an empty string are not the same thing, but if you just need the latter:
Set Text [Text] to ''