please include function shootScreen2. static void shootScreenAsPNGFile(File f) ctex { if (shootScreen_useScrot) { if (!isOnPATH("scrot")) shootScreen2_fallback(); if (shootScreen_useScrot) { try { mkdirsFor(f); S cmd = "scrot " + bashQuote(f); S out = backtick(cmd); if (f.exists()) ret; shootScreen2_fallback(); } catch e { print(e); shootScreen2_fallback(); } } } savePNG(f, new Robot().createScreenCapture(screenRectangle())); }