Update progress bar from within a script