- Home /
Close script tab in VS, from script
A script can be launched in Visual Studio, using this
AssetDatabase.OpenAsset(MonoScriptObj);
Is there any way to close an open-script tab in VS, doing something similar? There is no command for
AssetDatabase.CloseAsset(MonoScriptObj);
I am not aware of any way to callback to VS. Is it even possible?
Too be precise this doesn't open script in VisualStudio, but in your selected script editor. This is quite important in this case, as you need to understand that Unity methods are not a VS thing and thus they are not a good way to achieve what you want.
It's possible that there is some VS API that can do what you need, but you will have better luck getting help on some VS forum, or maybe somewhere in a C# Stack Overflow.
I'm curious as to why you want this. It's dead easy to close a tab in VS itself. When you're not looking at VS, why do you care what tabs it has open?
If I open a new group of scripts from the Editor, it would be convenient if the ones I am done with close on their own.