I need to check the accessibility of a script Application.
Using the snippet below catches the lack of accessibility, but it also throws exactly the same error if the Safari page is not fully open, or does not contain a scrollbar.
Anyone know of a way of determining an Apps accessibility without this try trap. please? The error number in all cases is -1719.
try
set p to 9
tell application "System Events" to tell process "Safari"
set p to 10
set scrollPos to value of scroll bar 1 of scroll area 1 of group 1 of group 1 of tab group 1 of splitter group 1 of window 1 as text
set p to 11
end tell
on error errmsg number errnum
if (errmsg as text) contains "assistive access" then
tell application "System Preferences"
activate
set p to 18
tell pane id "com.apple.preference.security" to reveal anchor "Privacy_Accessibility"
end tell
activate
display dialog "ScrollPos setting error. " & errmsg & " I have opened 'System Preferences'. Please set the preference of 'Accessibility' in 'Security & Privacy', & tick the 'Safari' & 'Safari Looper' boxes. " & " Error number " & errnum as text buttons {"STOP"} default button "STOP" giving up after 120
set my keyReturned to button returned of the result
set p to 17
if my keyReturned = "STOP" then error number -128
end if
end try
And what, you ask, was the beginning of it all?
And it is this......
Existence that multiplied itself
For sheer delight of being
And plunged with numberless trillions of forms
So that it might
find
itself
innumerably
Sri Aurobindo