/////////////////////////////////////////////////////////////////////////////// function logger(level, msg) { // verbosity logging, print "msg" only if "level" is equal or // higher than the value of the global variable "loglevel" // levels: 0:quiet, 3:warn, 4:info, 5:debug if (loglevel - level >= 0) print(msg); } function window_exists(title) { // walk through the list of open (non-image) windows and // check if a window with the given title exists windows = getList("window.titles"); for (i=0; i