Scripting Resources for DigitalMicrograph™

banner

Dave Mitchell's DigitalMicrograph™ Scripting Website

Home | Scripts | Examples | Functions | Recent Updates | Tutorials | Resources | Publications | Consulting | Projects | Contact & Bio |PyJEM| Search

 

Close All Hidden Images
Function
Closes all hidden images.
Version
version:20021109, v2.0
Author
D. R. G. Mitchell
Acknowledgements
-
Comments
This functionality has been included in the DisplayTools control palette.
System Requirements
Should be compatible with all recent versions of DigitalMicrograph.
Known Issues
Note - this script will close hidden images without saving any changes which have been made to them.
Supported
Yes
Included Files
Main script file.
Source Code

// Script to close all hidden images (without saving any changes!)

// D. R. G. Mitchell Nov. 2002

// adminnospam@dmscripting.com (remove the nospam to make this email address work)

// v2.0

// version:20021109

 

imagedocument img

number shown, hidden, totalimg, i

 

// Document windows of type 5 are those which are shown

 

shown=CountDocumentWindowsOfType(5)

 

// Loop to close all the hidden images

while(3>2)

{

try

{

img=getimagedocument(shown)

imagedocumentclose(img,0)

}

Catch

{

beep()

exit(0)

}

}