I am writing a application that can run shell commands remotely. I need to run the command: tc -l 455
as an administrator. I decided to run this command in applescript with administrative privileges but in objective c I need to take this output and display it in a NSTexView. Here is my code:
NSAppleScript* runWithAdminPrivileges = [[NSAppleScript alloc] initWithSource:@"do shell script \"nc -l 455\" with administrator privileges"];
NSDictionary *error = [[NSDictionary alloc] init];
[runWithAdminPrivileges executeAndReturnError:&error];
NSLog(@"%@", error);
The command is running but I have no way of seeing the output. Is there a way to do this with my code or is there a way to run this shell command in objective c with admin privileges and view the output?
Thanks in advance,