Progress Bar in ASS project

Hello All,

I am building an project in AS Studio and would like to add a progress bar.

How can I get status from the Terminal display (…10…20…) to reflect in the progress bar?

Thank you,

Damon

try
	activate
	tell application "Terminal"
		activate
		do shell script "sudo asr -source /volumes/mydrive -target /volumes/mydrive2 -erase -noprompt -nocheck" --password " " with administrator privileges
	end tell
end try

The short answer, according to this “do shell script” TechNote, is you don’t. Unfortunately, I think the best you could probably do would be to use an indeterminate progress bar, which of course isn’t that helpful.

I think the real solution would be to use Cocoa’s NSTask, but I know that for me at least, it’s waaay over my head at this point.

from that TechNote:

"Q: How do I control an interactive tool like ftp or telnet with do shell script?
A: The short answer is that you don’t. do shell script is designed to start the command and then let it run with no interaction until it completes, much like the backquote operator in most Unix shells or the system call in awk and Perl.

However, there are ways around this. You can script Terminal and send a series of commands to the same window (though this only works in Mac OS X 10.2 and later), or you could use a Unix package designed for scripting interactive tools, such as expect. Also, many interactive commands have non-interactive equivalents. For example, curl can substitute for ftp in most cases.

Q: My script will produce output over a long time. How do I read the results as they come in?
A: Again, the short answer is that you don’t – do shell script will not return until the command is done. What you can do, however, is to put the command into the background (see the next question), send its output to a file, and then read the file as it fills up.

Hope this helps…

Thank you for the clarification. I guess I will just use the indeterminate progress bar. The NSTask would be way over my head too.

Thank you,

Damon