Use case : I log in as " user1 " and start Safari, then I click " user1 " in the upper right corner and switch user " user2 ". Now I am trying to determine if Safari works for " user1 ", but I cannot do this with standard calls. I am using OS X 10.8 Mountain Lion to develop and run my code.
I used the following, but in vain:
[[NSWorkspace sharedWorkspace] runningApplications] - Safari does not exist in the listGetNextProcess() - Safari does not appearGetProcessForPID() - I get a "no such process" error
But when I do ps -aef | grep Safari ps -aef | grep Safari from the terminal, I can see Safari. (This applies not only to Safari, but also to other applications.)
Someone can help. Thank you very much.
source share