def run(self): if self.hidden: psn = ProcessSerialNumber(0, kCurrentProcess) ApplicationServices.TransformProcessType(psn, kProcessTransformToUIElementAppication) else: psn = ProcessSerialNumber(0, kCurrentProcess) ApplicationServices.TransformProcessType(psn, kProcessTransformToForegroundApplication) self.win.makeKeyAndOrderFront_(None) self.win.display() NSApp.activateIgnoringOtherApps_(True) NSApp.run()
def run(self): # You could adjust the 1.0 here to how ever many seconds you wanted to wait between checks to terminate self.timer = NSTimer.scheduledTimerWithTimeInterval_target_selector_userInfo_repeats_( 1.0, self, self.checkProcess_, None, True) NSApp.run()
def run(self): NSTimer.scheduledTimerWithTimeInterval_target_selector_userInfo_repeats_( 0.1, self, 'runAndStop:', '', False) NSApplication.sharedApplication() NSApp.run()
def run(self): # You could adjust the 1.0 here to how ever many seconds you wanted to wait between checks to terminate self.timer = NSTimer.scheduledTimerWithTimeInterval_target_selector_userInfo_repeats_(1.0, self, self.checkProcess_, None, True) NSApp.run()