Jump to content

"do shell script" freezes application indefinitely.

  • Please log in to reply
1 reply to this topic



    InsanelyMac Protégé

  • Members
  • Pip
  • 44 posts
  • Gender:Male
  • Location:Canada
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:

Posted Image



    InsanelyMac Sage

  • Members
  • PipPipPipPipPip
  • 350 posts
  • Location:Russia
You would need to run the process on a separate thread which, as far as I know, is totally impossible to do in applescript.

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

© 2017 InsanelyMac  |   News  |   Forum  |   Downloads  |   OSx86 Wiki  |   Designed by Ed Gain  |   Logo by irfan  |   Privacy Policy