GetProcessForPID is deprecated; what to use instead?
I have been using GetProcessForPID to get the ProcessSerialNumber for the running application, as in
ProcessSerialNumber psn;
int pid = [[NSProcessInfo processInfo] processIdentifier];
OSStatus error = GetProcessForPID(pid, &psn);
I then use this ProcessSerialNumber to create an event tap with CGEventTapCreateForPSN.
As of OS X 10.9, GetProcessForPID is deprecated.
What is the recommended replacement function in Cocoa or in Core Foundation?
Best,
-Michiel.