Automatically select last created object(s) when the operation ends?

 From:  Flowgun
10650.1 
Hello everyone,

so, since I usually make operations to newly created objects, especially curves, I wanted to add the functionality of automatically selecting them to certain commands.
I don't understand programming well enough to achieve this. For example, I tried combining the Rectangle script with the "select Last created objects" script, but the best result I was able to obtain is to select the previously created object and not the newly created one when I confirm (I guess the function gets compiled before so it doesn't register the last one?).

Anyways, I'm pretty sure there's a very simple way to do it. I tried a "setTimeout()" in case it needs delay to grab the newly created object, but this function is not supported in MoI.
I tried to study the code of various scripts in order to find a way, and even find resources about MoI API as I was ready to take a deep dive into it, but it seems that most resources are no longer available.

I think that it would be great if objects get automatically selected after creation by default. Especially curve objects since oftentimes they are directly followed by an operation to them.
For future updates, maybe confirming with Middle mouse button would keep the objects selected. that would be an awesome functionality, no?

otherwise, for a script that exits with the newly created objects selected, I can conceive like 3 main scenarios that might need different scripts:
* nothing else is selected during creation: no issues - just select the newly created one. this doesn't interfere with other cases at all.
* there's a selection:
- overwrite it: I guess this is the wanted behavior in most cases - it avoids accidently doing operations to other elements in the scene.
- add to it: such a script can be useful for example after array operations, as the older object(s) are part of the whole.
- keep it and exit without affecting initial selection (the current Default): I guess this would be a rarely needed, but you can't blame someone for being too precious about his selection.

* Another awesome feature would be undo/redo scripts that keep objects as they are and undo/redo only selections. This would take MoI's selection capabilities to the next level.

I hope Michael or anyone can help me with this, and I hope that my feedback is useful =)