I actually replied in a different thread on how to catch spaces in a on input
https://forums.mirc.com/showthreaded.php?Cat=&Board=scriptsandpopups&Number=67894