public void drawPathTo(SikuliGuide guide, String search_string) { Enumeration<GUINode> e = ((GUINode) getRoot()).breadthFirstEnumeration(); e.nextElement(); // pop the root GUINode matched_node = null; while (e.hasMoreElements()) { GUINode node = (GUINode) e.nextElement(); // fuzzy matching hack String s1 = removeSpaces(node.name.toLowerCase()); String s2 = removeSpaces(search_string.toLowerCase()); if (Math.abs(s1.length() - s2.length()) < 3 && Distance.LD(s1, s2) < 3) { matched_node = node; break; } } Debug.info("matched_node: " + matched_node); if (matched_node != null) { Match m = matched_node.findOnScreen(); if (m != null) { guide.addToFront(new SikuliGuideRectangle(m)); } else { GUINode ancestor = matched_node.findAncestorOnScreen(); if (ancestor != null) { matched_node.drawPathFromAncestor(guide, ancestor); } } } }