def run(self): # set up the application self.app = NSApplication.sharedApplication() self.delegate = self.createAppDelegate().alloc().init() self.delegate.activity_tracker = self.activity_tracker self.app.setDelegate_(self.delegate) self.app.setActivationPolicy_(NSApplicationActivationPolicyAccessory) self.workspace = NSWorkspace.sharedWorkspace() # start listeners for event recorders self.cr = ClickRecorder(self) self.cr.start_click_listener() self.kr = KeyRecorder(self) self.kr.start_key_listener() self.mr = MoveRecorder(self) self.mr.start_move_listener() self.sr = ScrollRecorder(self) self.sr.start_scroll_listener() self.clr = ClipboardRecorder(self) # AppRecorder starts accessibility listeners that need to be on a # separate thread self.ar = AppRecorder(self) self.art = threading.Thread(target=self.ar.start_app_observers) self.art.start() #TODO add file system tracking # https://developer.apple.com/library/mac/documentation/Darwin/Conceptual/FSEvents_ProgGuide/UsingtheFSEventsFramework/UsingtheFSEventsFramework.html # run the Traces application AppHelper.runEventLoop()