So, I want this script to set the Text property of the TextBox to a string called command, and then move the cursor to the end of the string.
local command = CommandName.Text CommandBar.Text = command CommandBar.CursorPosition = 100000
Very easy right? Well, the problem is.. it adds the string correctly, but it also adds a "space" after it. This wouldn't be a problem for me but the thing is that other scripts do NOT recognize that "space" as a normal space (like " ") and I need to delete that space everytime. I don't understand what's the problem.
(check comments)
I found the solution: Basically I press the "enter" key to insert the command, and that "fake space" was actually a new line character. That character is inserted AFTER the script changes the text value, so I added a "wait()" and now it works. Thank you @Benbebop for helping me find the solution