It took all night (well its 4:18, but I’m counting it as all night) to figure this out.
Give it a name in InterfaceBuilder (click the required “on clicked” handler). There is some “call method” way of disabling clicking on it, but I don’t need to do that. Set up your ticks and values (I used 100). Name it (here it’s “LevelIndicator”).
I used this after a on drop/on open handler when my program added files:
on add_some_files(names)
set file_count to the count of names
set file_ratio to (100 / file_count) as integer
set the_level to 0
repeat with a_file from 1 to file_count
[boring file stuff...]
set the_level to the_level + file_ratio
call method "setIntValue:" of (control "LevelIndicator" of window "main") with parameters {the_level}
end repeat
end add_some_files
Ahhhh, Calgon, take me away…