progrium / darwinkit

Native Mac APIs for Go. Previously known as MacDriver
MIT License
5.04k stars 160 forks source link

Unable to Retrieve PID from NSRunningApplication #260

Closed kearth closed 5 months ago

kearth commented 5 months ago

The NSRunningApplication object in macOS has a processIdentifier property to obtain the PID. The new version of darwinkit does not have this ProcessIdentifier()method. How can we now get the PID of NSRunningApplication? image Thank you.

progrium commented 5 months ago

you can always use objc.Call to use selectors/properties without bindings, but I just added support for members using pid_t. This method should be available in main.