We didnt have 2 sessions of our plug-in/Photoshop being invoked. The admin user was just physically logged in for other purposes. So, only 1 instance was running of Photoshop/our plug-in/background process always under the Standard user account.
To answer your questions the following is the code we use for finding/launching is below -
[[NSWorkspace sharedWorkspace] openApplicationAtURL:app_path configuration: configuration completionHandler:^(NSRunningApplication* app, NSError* error)
if (error) {
NSArray *directory_path_arr = NSSearchPathForDirectoriesInDomains(NSApplicationSupportDirectory, NSLocalDomainMask, YES);
NSString *filePath = nil;
if(directory_path_arr)
{
NSString *directory_path = [directory_path_arr objectAtIndex:0];
NSString *filePath = [directory_path stringByAppendingPathComponent: [NSString stringWithUTF8String:(const char *)gAppSupportFolderName]];
if(filePath)
[[NSWorkspace sharedWorkspace] launchApplication:filePath];
}
NSLog(@"Failed to run the app: %@", error.localizedDescription);
}
}];
Configuration is set to
[configuration setPromptsUserIfNeeded: NO]
We use TCP/IP sockets to communicate between the plugi-n and our background process.