How to show progress when use do shell script?

Discussion in 'Mac Programming' started by mikezang, Aug 27, 2012.

  1. mikezang macrumors 6502a

    Joined:
    May 22, 2010
    Location:
    Tokyo, Japan
    #1
    I am using curl to download file, it will show a progress when I run it on terminal.

    But when I run it with "do shell script curl" in AppleScript, the progress isn't shown, how can I show that progress?
     
  2. Red Menace macrumors 6502

    Red Menace

    Joined:
    May 29, 2011
    Location:
    Littleton, Colorado, USA
    #2
    Regular AppleScript doesn't have a progress bar, you would need to use something like ASObjC Runner or roll your own using a Cocoa-AppleScript application. However you decide to implement a progress bar, one way to get the progress from curl would be to redirect the shell script output to a file and use that to update your progress bar.
     
  3. mikezang thread starter macrumors 6502a

    Joined:
    May 22, 2010
    Location:
    Tokyo, Japan
    #3
    Thanks for you answer. I have another way to show original curl progress, but I have to get the result from AppleScript in bash shell, that result is a 2d array, how can I get it easily?
     

Share This Page