Hello guys, I came up with an idea, how can I do it from the top menu, for example, I select some script so that this script is opened by an inspector with some script? (Not selected in the scene but present)
[MenuItem] if you wanted to know how to create a menu item. The part about selecting, opening script with script is too vague, please clarify.

