static void aiConceptsImageGrabber_run(double delay) { RemoteDB db = new RemoteDB(aiConceptsProgram()); repeat with sleep delay { AIConcept c = findWhere(AIConcept, suggestedImage := null, searchedForSuggestedImage := false, importedFrom := null); if (c != null) { cset(c, searchedForSuggestedImage := true); S query = c.name; print("Visualizing: " + c.name); BufferedImage img = quickVisualize(query); if (img != null) db.xset(rc, suggestedImage := new PNGFile(quickVisualize_imagePath(query)), suggestedImageMD5 := md5OfBufferedImage(img)); } else print("No image found"); } } }