2

Okay, so I have an AppleScript that is really just a wrapper for a simple shell script, so I could turn it into a double-click to run application, droplet and URI handler on OS X.

Anyway, this works fine but the only problem is that the shell script can take a while to run. So I'm wondering, what options do I have for displaying some kind of progress indicator?

I'm not looking for anything too complex, ideally something I can do simply via AppleScript commands. For example, is there a way I can trigger a shell command to run in the background at the start of my script, then use a loop to query whether the command is finished or not, and somehow provide feedback to the user?

  • What command(s) is/are being run in your shell script? – tubedogg Aug 13 '13 at 20:53
  • It's actually a set of commands being run on a remote server. The main component is a find command that takes a long time to complete, but piped into another command that filters the results down to only what I want back for my AppleScript. So with the delay in connecting initially, plus the length of the find operation the command is very slow. – Haravikk Aug 15 '13 at 10:36
  • 1
    @Haravikk If you move the whole project over to ApplescriptObjC, a progress bar would be just a few clicks away. Furthermore, you could use threading for your bash – scohe001 Aug 20 '13 at 16:55
  • Is that necessary? What about if I launched the process in a do shell command using ampersand (background process)? Can I then use AppleScript to then just keep checking the process to see if it's still running and grab its results from a file when it closes or something? – Haravikk Aug 21 '13 at 19:10

You must log in to answer this question.

Browse other questions tagged .