public Region waitForWindow(int seconds) { Region win = null; while ((win = window()) == null && seconds > 0) { aRegion.wait(0.5); seconds -= 0.5; } return win; }
if (runTime.runningMac) { app = new App(appsMac.get(appType)); if (app.window() != null) { app.focus(); aRegion.wait(0.5); win = app.window(); aRegion.click(win); aRegion.write("#M.a#B."); if (app.window() != null) { app.focus(); aRegion.wait(0.5); win = app.window(); aRegion.click(win); aRegion.write("#C.a#B."); if (runTime.runningWindows) { app = new App(appsWindows.get(appType)); if (app.window() != null) { app.focus(); aRegion.wait(0.5); win = app.window(); aRegion.click(win);