Jump to content

"do shell script" freezes application indefinitely.


2 posts in this topic

Recommended Posts

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:

 

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

 

And this is the application itself:

 

3427361917_0fb9525de7_o.png

Link to comment
Share on other sites

 Share

×
×
  • Create New...