Help - Search - Members - Calendar
Full Version: "do shell script" freezes application indefinitely.
InsanelyMac Forum > Apple World > Mac Programming and Development
Skyfluff
Hey guys,

This is probably a simple one, but I'm pretty new to Xcode and a little bit stumped.

I'm writing up a simple app to run "yes > /dev/null" in terminal just to save some time when stressing my CPU, but when I run the script (assigned to a button) the application freezes and no other buttons can be pushed (for example, the Activity Monitor and Grapher launchers become unresponsive). Ideally, I'd like to be able to push the Terminal button to start the script, and push it again to kill the script. But since the app freezes until the process finishes (which, it never will) I can't seemingly do this.

This is the Applescript assigned to the Terminal Icon:

CODE
on clicked theObject
    do shell script "yes > /dev/null & yes > /dev/null & tick" with administrator privileges
end clicked


And this is the application itself:

stroke
You would need to run the process on a separate thread which, as far as I know, is totally impossible to do in applescript.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.