Heeeeellllllpppppppppp!!!! Please!!! Progress Bar Problem!!!

HI FOR ANYONE THAT CAN PLEASE HELP ME YOU’LL BE MY SCRIPTING HERROOOO!!!

Ok i cant seem to get my progress bar increasing by 5 every 10 seconds i want to control the progress bar manually tho i did it like this in “Applescript Studios”


set contents of progress bar "progress" of window "window1" to 5 
delay 10.0 
set contents of progress bar "progress" of window "window1" to 10

I WANT TO DO THE ABOVE ^^^^^^^^^ IN APPLESCRIPTOBJC

HEEEELLLLPPP

Assuming progBar is an outlet to the a bar:

progBar's setDoubleValue_(5)
current application's NSTimer's scheduledTimerWithTimeInterval_target_selector_userInfo_repeats_(10, progBar, "setDoubleValue:", missing value, false)

Shane might have missed the 5 parameter there???

He missed everything. Let’s try again…

 progBar's setDoubleValue_(5)
 current application's NSTimer's scheduledTimerWithTimeInterval_target_selector_userInfo_repeats_(10, me, "timerFired:", 10, false)


on timerFired_(theTimer)
   log theTimer
   log theTimer's userInfo()
   progBar's setDoubleValue_(theTimer's userInfo())
end timerFired_	

… or more simply:

progBar's setDoubleValue_(5)
performSelector_withObject_afterDelay_("setDouble:", progBar, 10)

Huh??? This can’t work. Staying up too late, Shane?

If you want it to increment by 5, every 10 seconds until it reaches 100, then you should do this:

on applicationWillFinishLaunching_(aNotification)
		progBar's setDoubleValue_(5)
		current application's NSTimer's scheduledTimerWithTimeInterval_target_selector_userInfo_repeats_(10, me, "timerFired:", 5, true)
	end applicationWillFinishLaunching_
	
	on timerFired_(theTimer)
		progBar's incrementBy_(theTimer's userInfo())
		if progBar's doubleValue() as integer is 100 then theTimer's invalidate()
	end timerFired_

Ric

Definitely.

I was too busy looking at the code, which didn’t mention “repeat” – I thought it was a one-off.