Jump to content
  • Announcements

    • Allan

      Forum Rules   04/13/2018

      Hello folks! As some things are being fixed, we'll keep you updated. Per hour the Forum Rules don't have a dedicated "Tab", so here is the place that we have our Rules back. New Users Lounge > [READ] - InsanelyMac Forum Rules - The InsanelyMac Staff Team. 
Sign in to follow this  
Skyfluff

"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

Share this post


Link to post
Share on other sites

You would need to run the process on a separate thread which, as far as I know, is totally impossible to do in applescript.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×