def main(): paul = Application(Tk()) setup_gui(paul) res = IO(paul) brain.set_IO(res[0], res[1]) paul.mainloop()
temp_holder = "" temp_q_holder = "" def get_text_simple(): q = temp_holder code = ('display dialog "' + q + '" default answer ""\n' + 'set res to text returned of result\n' + 'return res') result = brain.paul.run_script(code, language="applescript", response=True) return result def set_text_simple(text): global temp_holder temp_holder = text brain.paul.send_notification(temp_q_holder, text) if len(argv) > 1: brain.login("default") paul = Application(Tk()) setup_gui(paul) brain.set_IO(set_text_simple, get_text_simple) temp_q_holder = " ".join(argv[1:]) brain.process(temp_q_holder) else: main()