// Script function: Name the opened images in order of "the front most, second front most and so on"
// Requirement to run the script: Open a couple of images

// 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

image EMcurrent
EMcurrent = GetFrontImage()
showimage (EMcurrent)

number i =0
While(EMcurrent.ImageIsValid())
{
EMcurrent.Setname("Image " + i + " : " + EMcurrent.Getname()) 
EMcurrent := FindNextImage(EMcurrent) 
i = i+1
result (i + "\n")
}
