1

NSEvent

https://developer.apple.com/documentation/appkit/nsevent

set var1 to current application's NSEvent's pressedMouseButtons()
say var1

set var1 to current application's NSEvent's buttonNumber()
say var1

First one works, but second one doesn't work, how to solve it?

[AppDelegate main:]: +[NSEvent buttonNumber]: unrecognized selector sent to class 0x7fffb09df330 (error -10000)

1
  • "Accessibility Inspector" should help you to choose appropriate property of any controls you want. Commented Nov 20, 2017 at 14:29

1 Answer 1

1
  • pressedMouseButtons is a class property.

  • buttonNumber is an instance property, to be called on an instance.

You need to create an event or receive an event to be able to use buttonNumber

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.