EditorUtility.OpenWithDefaultApp only one instance?

When you double-click a script file in the Unity editor, if you already have your generated solution open in MonoDevelop or Visual Studio, it will just refresh that instance of MonoDevelop/Visual Studio and not open a new one.

Is there an easy way to accomplish this, or is this some trick that Unity is using? I have a custom Editor menu item that launches a file in an external editor (using EditorUtility.OpenWithDefaultApp) and I want to ensure that if a user selects the same item twice in a row, it won’t open a new instance of the external editor.

Thanks!

As far as I know, that sort of feature would have to be developed per-application; there’s no easy, generic way to tell if a given application even supports this feature, or what API it would use to do so.

If you wrote the application in question, you could read up on turning it into what’s called a “singleton application”. Otherwise, you could check if the app has any option to enable that behavior.