In coding a Dopus script I found, the //dlg.query_edit.SelectRange(-1);
is not working as documented.
Instead of placing the cursor at the end of the contents in the Edit Control, it places the cursor at the beginning of the control (or has no effect).
Workaround:
dlg.query_edit.SelectRange(dlg.query_edit.value.length + "," + dlg.query_edit.value.length);
In above example, the query_edit is an Edit Control.