For example, I want to write the following macro in script in TeXstudio(using QtScript):
%SCRIPT
editor.write("\\textcolor{red}{}")
After invoking this macro, I want the cursor to move into the second pair of curly braces automatically. How can I modify my code to achieve the desired effect?
%SCRIPT
txt = "\\textcolor{red}{}"
cursor.insertText(txt)
cursor.movePosition(1,cursorEnums.Left)