progrium / darwinkit

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

Unable to Retrieve PID from NSRunningApplication #260

Closed kearth closed 4 weeks ago

kearth commented 4 weeks 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 4 weeks 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.