Hello
@bdm and many thanks for the quick and accurate reply.
bdm wrote: ↑Mon Jul 24, 2023 6:11 pm
you can select "Run -> Run file as script" (or Ctrl+Shift+E), but this will also restart the shell.
This way it works as expected, although there is actually one inconvenience here if your macro starts with: sel=Gui.Selection.getSelection(). It's a shame that "Run file as script" needs restarting the shell.
I will use the alternative method with inspect.currentframe() as per your instructions if needed. I should make a note of this somewhere so I don't forget.
By the way, I've been taking a look at the Pyzo GitHub, and I can see that you've made a lot of improvements regarding QT, among other things, for the latest release (congratulations on such great work!). I wanted to ask you, based on what I can see, do we still need the line QtCore.QCoreApplication.setAttribute(QtCore.Qt.AA_ShareOpenGLContexts, True) at the startUp script of the shell to avoid some annoying messages when starting the FreeCAD instance, or am I missing something and it's no longer necessary?