osx - Mouse events and switch -


i'm very new cocoa , i'm looking way execute applescript when mouse dragged, @ global level. need app running time , has no interface really, running in background , intercept mouse event in conditions.

so far, bit of code can close want applescript executed countless times instead of once.

- (void)applicationdidfinishlaunching:(nsnotification *)anotification {     [nsevent addglobalmonitorforeventsmatchingmask:nsleftmousedraggedmask handler:^(nsevent *event) {       if (nsleftmousedragged) //with more conditions          nsapplescript *run = [[nsapplescript alloc] initwithsource:@"myscripthere"];          [run executeandreturnerror:nil];          }      ]; } 


Comments

Popular posts from this blog

codeigniter - Fatal error: Call to undefined function lang() in CI Merchant using CardSave -

javascript - CasperJS/PhantomJS failing SSL handshakes on some sites even with --ssl-protocol=any -

python - Received unregistered task using Celery with Django -