!7 static bool use4dot0 = false; p { S options = "-oem 4"; // Neural Network for "best" traineddata // "--tessdata-dir " + platformQuote(userHome("Downloads")); File tesseract = userHome("local/bin/tesseract"); if (!fileExists(tesseract) || !use4dot0) { tesseract = findCmdOnPATH("tesseract"); options = ""; } if (tesseract == null) print("Tesseract not found on PATH"); File png = getProgramFile("screen.png"); print("Making screenshot."); hideConsole(); sleepSeconds(1); shootScreenAsPNGFile(png); showConsole(); print("Running Tesseract."); time { print(backtick(print(platformQuote(tesseract) + " " + platformQuote(png) + " stdout" + " " + options))); } }