Engage "Rename" mode on a gameObject from editor code?

If you right click a GO - you’ll get a context menu with some options, “Rename” is one of them, you click on it, and you get in Rename mode for that object (same could be achieved by pressing F2)

My question is, how can I do that via editor code? - I can select an object, but how to get in “Rename” mode?

From what I’ve seen working on editor codes, everything that’s doable in the Unity editor, is located ‘somewhere’ (undocumented) within the editor namespaces and classes. We just have to find it. (like, who would have thought that the “CopyComponent” feature is located in UnityEditorInternal.ComponentUtility?)

Thanks :slight_smile:

Question has been answered here.