Page 1 of 1
ScrollBar -Set Slider position with script - Solved
Posted: Sat Aug 31, 2013 1:56 pm
by DR White
How does one set the Slider position of a ScrollBar with script from a button?
I have tried the code below, but none work:
on mouseUp
set newValue of scrollbar "BooksScrollBar" to 2000
end mouseUp
also tried:
on mouseUp
set vscroll of scrollbar "BooksScrollBar" to 2000
end mouseUp
also tried:
on mouseUp
set field of scrollbar "BooksScrollBar" to 2000
end mouseUp
Definitely Need Help.
Thanks,
David
Re: ScrollBar -Set Slider position with script
Posted: Sat Aug 31, 2013 2:30 pm
by andrewferguson
Hi,
The property you are looking for is the thumbPosition
Code: Select all
on mouseUp
set thumbPosition of scrollbar "BooksScrollBar" to 2000
end mouseUp
Hope this helps,
Andrew
Re: ScrollBar -Set Slider position with script
Posted: Sat Aug 31, 2013 2:50 pm
by DR White
Andrew,
WOW!!
That works GREAT! Problem Solved!
Where could have I looked to find it out myself?
Thank You VERY MUCH,
David
Re: ScrollBar -Set Slider position with script
Posted: Sat Aug 31, 2013 3:03 pm
by Klaus
Hi David,
Where could have I looked to find it out myself?
here:
http://www.hyperactivesw.com/revscriptc ... ences.html
Maybe stack "Controls"
Best
Klaus
Re: ScrollBar -Set Slider position with script
Posted: Sat Aug 31, 2013 3:18 pm
by dunbarx
Sometimes a little detective work is required. If you had looked up "scrollbar" in the dictionary, you would have found a bunch of leads. And under the "object" type, which is the most pertinent if you think about it, you would have found an example using "thumbposition". You may not have immediately know what that meant, but that is how it is done.
Pay particular attention to the "see also" section of any dictionary entry. Those links are invaluable, and often lead to what you really need.
Craig Newman