advancing my progress bar
Posted: Thu Mar 29, 2012 9:23 am
Hi can someone help me with a little code to advance a progress bar for about a 4 second operation that involves getting the files of a folder and sending the list of files through several repeat loops to do some error checking regarding the file names, types,etc then does some math, etc, locks the screen, resizes some groups, and then eventually unlocks the screen.
I was using a handler in the stack and a progress bar i got from tactile media hence the "tm" before the commands in the script below. Then where ever I could find a repeat loop sticking the "ShowProgress" handler in to try and advance the progress bar but it wash"t really working well at all. Is there a way I can get it to march along for say 4 seconds and then when the script ends just hide it? Any help would be appreciated.
Dave
global tCurrentProgress
on ShowProgress
set the tmEndValue of control "myProgress" to 20
put the tmThumbPos of control "myProgress" into tCurrentProgress
if tCurrentProgress >= the tmEndValue of control "myProgress" then
put 0 into tCurrentProgress
else
add 1 to tCurrentProgress
end if
set the tmThumbPos of control "myProgress" to tCurrentProgress
end ShowProgress
I was using a handler in the stack and a progress bar i got from tactile media hence the "tm" before the commands in the script below. Then where ever I could find a repeat loop sticking the "ShowProgress" handler in to try and advance the progress bar but it wash"t really working well at all. Is there a way I can get it to march along for say 4 seconds and then when the script ends just hide it? Any help would be appreciated.
Dave
global tCurrentProgress
on ShowProgress
set the tmEndValue of control "myProgress" to 20
put the tmThumbPos of control "myProgress" into tCurrentProgress
if tCurrentProgress >= the tmEndValue of control "myProgress" then
put 0 into tCurrentProgress
else
add 1 to tCurrentProgress
end if
set the tmThumbPos of control "myProgress" to tCurrentProgress
end ShowProgress