user761025
user761025

Reputation: 21

AppleScriptObjC: ProgressBar does not increment

I am trying to implement a Progress bar update in AppleScriptObjC. I have connected the progressbar thru IB and trying to increment the Progressbar update via incrementBy(5). The Inderterminate property is set to false. the IB connection is fine because if I set the Inderterminate to true and uncomemnt the code to start/stop animation it works fine. this is the Error I get "-[NSProgressIndicator incrementby:]: unrecognized selector sent to instance 0x2007e2220"

following is the code

property ProgressBar : missing value

on MyBtnClick_(sender)

(*.. some code ..*)

ProgressBar's incrementby_(5)
ProgressBar's displayifNeeded()

--ProgressBar's startAnimation_(me)

--ProgressBar's stopAnimation_(me)

end MyBtnClick_

Thanks in Adv for any pointers.

regards, Jesse

Upvotes: 0

Views: 910

Answers (2)

YeaTheMen
YeaTheMen

Reputation: 1083

Ok so, "unrecognized selector sent to instance" means that the command sent is unknown so the command your sending to it means it does not exist, however If you are trying to send a message to make the progress bar to set its progress % then, i can help you! :D, I use the "setDoubleValue" command to set the Progress bars status and you don't need to startAnimation and stopAnimation it either :D

ok so here is a script that will store the current progress and when MyBtnClick is run, it will add 5% to the progress bar

property ProgressBar : missing value
property currentProgress : 0

on MyBtnClick_(sender)

(*.. some code ..*)

set currentProgress to currentProgress + 5
ProgressBar's setDoubleValue_(currentProgress)

end MyBtnClick_

hope this helps :D

Upvotes: 1

Shane Stanley
Shane Stanley

Reputation: 11

Try incrementBy_ -- case matters.

Upvotes: 1

Related Questions