// Script function: Count the number of images opened

// Unless named starting with GlobalSino, EM, My, Self, the function commands are defined 
//by Gatan DM, please see at link: http://www.globalsino.com/EM/page2597.html

number GlobalSinoWindows=Countdocumentwindowsoftype(5)
if(GlobalSinoWindows<1)
	{
		Showalert("Please at least open one image!",2)
		exit(0)
	}
		
Result("You have "+GlobalSinoWindows +" images opened\n")

Showalert("You have "+GlobalSinoWindows +" images opened\n", 2)


