progress indicator

How do I connect a progress indicator to a button so when the button is clicked, it runs the applescript for the button and starts the progress indicator? The button and the progress indicator are in the same window…

on clicked theObject
	do shell script "/usr/libexec/locate.updatedb" 
end clicked

Here. This is also in the “AppleScriptKit.asdictionary” in PB and in many of the example files


on clicked theObject
--MAKE THE PROGRESS BAR USE THREADED ANIMATION
set uses threaded animation of progress indicator "progressBar" of window "main" to true
--START THE PROGRESS BAR
	start progress indicator "progressBar" of window "main"
	do shell script "/usr/libexec/locate.updatedb" 
--STOP THE PROGRESS BAR
stop progress indicator "progressBar" of window "main"
end clicked