Hi,
Been trying to write a script a handler which can be called
to tell Safari to stop loading a web page. (I am parsing
source code from web pages, so as soon as the source
is downloaded I don’t need Safari to build the page,
and I don’t want Safari to get hung up trying start
playing songs or animations or whatever.)
I downloaded the following code from this board,
and several users remarked that it worked. But it
doesn’t seem to work for me:
[code]
on stopSafari()
tell application “System Events”
tell process “Safari”
→ if the reload/stop button is visible, you can use this without activating Safari
click button “Stop” of window 1
end tell
end tell
end stopSafari[/code]
Problem is two-fold:
- It either seems to do nothing
or
- it throws a “NSReceiverEvaluationScriptError: 4” error.
I have checked to make sure that “enable access for assistive devices”
is turned on
Any suggestions would be appreciated. Thanks.
-Jason