ScriptEditor - focus papercut

This is kind of a funny and possibly rare phenomenon, but I thought I would report it here. I am testing various scripts for compatibility between Py 2 and Py 3, so I have both EditPythonScript and ScriptEditor open at the same time. I have two monitors, on one of which has the main Rhino window; both the editors are on the other monitor.

Let’s say I have a bunch of curves in the Rhino window and I want to select all of them to do something with. I have a script that starts with just GetObjects().

import rhinoscriptsyntax as rs
crvs=rs.GetObjects("Select some curves",4)

If I launch this from the EditPythonScript window, the EditPythonScript editor disappears on the second monitor - revealing the inactive ScriptEditor window behind it in the process - then I do a Ctrl+A to select all the curves, they are indeed selected. OK, fine that works as expected, Esc to cancel.

Now, let’s try it the other way. I have the same scriptlet now in ScriptEditor, I launch it, the ScriptEditor window disappears revealing the inactive EditPythonScript window behind it. I do a Ctrl+A. Instead of selecting the curves in the Rhino window, it selects all the text in the open EditPythonScript window… :grimacing:

This happens even if I move the mouse cursor over the Rhino window first before doing the Ctrl+A. I actually need to LMB click once in the main Rhino window before Ctrl+A will actually select the curves.

thanks Mitch,

RH-81285 ScriptEditor: bring focus to Rhino when launching a script