G’day scripters
Thanks Shane, I’ll look at that.
Phil, it’s not important that I determine the scroll position accurately, which does fluctuate as the site being displayed loads more pages, but I merely need to know if the scroll position is 0.0, 1.0 (or greater, so finished), or in-between.
Unfortunately, as Bill pointed out, Safari is unreliable in determining scroll position. I’ve found between Safari starts, it seems to vary in it’s responses, and also acts up on certain sites, and not others.
It’s a bit of a bummer, but not important. My App still does what it was intended to do, freeze my iMac! Just thought others might like to know of the problem, and check for remedies.
Also, does anyone else suffer from the freezing iMac syndrome? I have a 4GB graphics card, and am wondering if it’s the problem. OR, my 32GB third party RAM (Crucial brand).
Regards
Santa
On 1 Sep 2016, at 4:16 PM, Phil Stokes < email@hidden> wrote: I understand the need to scroll programmatically - I meant I don’t understand the need to locate the scroll bar element in the UI, which will change depending on the window’s bounds and thus be unreliable for coding.
In AppKit framework, NSResponder has scrollToBeginningOfDocument and scrollToEndOfDocument methods, which you could try implementing in ASObjC. I suspect you’d first have to get a reference to the Window’s text or webkit view to call it.
Another way to scroll up and down entirely might be just to get each page’s contents, and try to alternately set the insertion point or location at the beginning or end of the range.
I’m not at a computer I can play with code at the moment, but I’ll have a mess about with these a bit later to see if I can come up with some concrete code examples.
Best
P
|