On 4 Oct 2006, at 02:45, Luther Fuller wrote:
On Oct 3, 2006, at 7:28 PM, Robert Poland wrote:
I have been trying to find a command that will set the scroll to the top of the window but haven't any luck.
So have I ... but that was some time ago.
If the window is sorted by name, in list or icon view, you can use ...
try -- folder may be empty
select first item of folderRef
end try
It not as good as a 'set scroll to 0' command.
But ... there is no 'set scroll to 0' command.
Something approximating that might be achieved with GUI scripting. However, since window structures can vary significantly from one app to another, a fair amount of homework would be required for anything approaching a general-purpose routine.
Here's an example that should work for a Finder window:
----------------
tell application "System Events" to tell (first window of application process ¬
"Finder" whose description is "standard window") to if (exists) then
set t to it
tell splitter group -1 to if exists then set t to it
set value of scroll bar 1 of t's scroll area -1 to 0
end if
----------------
---
kai