Questions tagged [nstask]

NSTask Class on OS X API , lets you run another program as a subprocess and monitor that program’s execution

459 questions
0
votes
0 answers

Erratic action of NSToolbarItem

I am using toolbar buttons to control a simple NSTask. The code below works as expected when the IBAction is given by regular buttons, but produces artifacts when it is given by an NSToolbarItem. More precisely, the run button does not get disabled.…
0
votes
1 answer

Multiple NSTasks Causing Inconsistent Output

I am working on a Swift app that interacts with external binaries (via NSTask) and returns the output as an array of strings, for each line. When calling the executeCommand function multiple times, commands start failing to return expected data. In…
0
votes
1 answer

How to be notified of an NSTask's terminationStatus after it exits without blocking?

OS X Deployment Target: 10.11 Given an NSTask, that has an assigned qualityOfService what is the recommended way to be notified when the task exits (i.e. waitUntilExit) without blocking? A NSBackgroundActivityScheduler. Assigned the same quality…
qnoid
  • 2,346
  • 2
  • 26
  • 45
0
votes
1 answer

How to handle tabulated terminal output after NSTask command execution with Swift

I managed to execute terminal command from OSX app but the problem is that the data is tabulated. So I'm kindly asking if someone knows how to parse this to some data structure from where I can get single value in specific row and column. The other…
KO55A
  • 39
  • 9
0
votes
1 answer

NSTask to execute a find command with arguments

I am trying to execute a terminal command from NSTask but it's seems that I do something wrong. I have tried this: NSTask *task = [[NSTask alloc] init]; task.launchPath = @"/bin/bash"; NSString *arr = [NSString stringWithFormat:@"find %@ -type f…
BlackM
  • 3,927
  • 8
  • 39
  • 69
0
votes
1 answer

AMShellWrapper sending data to a running task

I'm in the process of converting AMShellWrapper to my own application that runs an SH file that has userinput. Therefore, I need to send data to a running task. Any ideas? Elijah
objectiveccoder001
  • 2,981
  • 10
  • 48
  • 72
0
votes
2 answers

NoClassDefFoundError when running shell script

Here is the error: Exception in thread "main" java.lang.NoClassDefFoundError: org/alicebot/server/net/AliceServer Caused by: java.lang.ClassNotFoundException: org.alicebot.server.net.AliceServer at…
objectiveccoder001
  • 2,981
  • 10
  • 48
  • 72
0
votes
0 answers

Update value in Info.plist of other application

Problem: I have an installer app which downloads an application in "/Applications/". I want to change some value in Info.plist of newly downloaded application when installer finishes. Possible solution: We can use plistbuddy and NSTask() to run a…
Saqib Omer
  • 5,387
  • 7
  • 50
  • 71
0
votes
1 answer

Example of NSTask performing complex pipelines

Can someone post code to show this? Elijah
objectiveccoder001
  • 2,981
  • 10
  • 48
  • 72
0
votes
1 answer

Running terminal command in swift doesn't work

I'm trying to check if a brew command is available using command -v brew. Example output in terminal: MacBook-Air-USER:~ USER$ command -v brew /usr/local/bin/brew I'm using this code: func runCommand(command cmd : String) -> Array { …
pomo_mondreganto
  • 2,028
  • 2
  • 28
  • 56
0
votes
1 answer

I can't see the output of NSTask - objective-c JAVA

Here is my code: NSTask *setupTask = [NSTask new]; [setupTask setLaunchPath:@"/bin/sh"]; [setupTask setArguments:[NSArray arrayWithObject:@"/applications/jarvis/brain/server.sh"]]; [setupTask setCurrentDirectoryPath:@"/"]; NSPipe *outputPipeSetup =…
objectiveccoder001
  • 2,981
  • 10
  • 48
  • 72
0
votes
1 answer

Run more then one terminal commands with NSTask

in swift my project i m planing to use terminal commands for getting some data. For this purpose i found some code and create a function. If i call this function one time there is no any problem. It works great. But if i call these function 2 times…
0
votes
0 answers

Getting success result on shell script executing installer pkg within an NSTask Swift

I am building an installer for an OS X application in Swift 2.0. The installer does little more than take user input, sends it to a server, and builds a desktop shortcut determined by server response. This shortcut (the 'application') opens up…
richardjc
  • 89
  • 7
0
votes
2 answers

will it be rejected by MAS to open Safari or other apps with NSTask and open command

I'll open Safari, other system apps and third-party apps with codes like: let task = NSTask() task.launchPath = "/usr/bin/open" task.arguments = ["Safari"] task.launch() will it be rejected by MAS review? I know there is recommended way by Apple…
guoleii
  • 496
  • 6
  • 15
0
votes
1 answer

Getting dysmutil malloc error when using nstask Tool Exited with code 134

This is the code i am using to generate ios build using nstask in my cocoa app. NSTask *task=[[NSTask alloc]init]; task.launchPath=@"/library/Frameworks/Mono.Framework/Commands/xbuild"; task.arguments=…
Ankur jain
  • 51
  • 4