• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Determining accessibility of Applescript App?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Determining accessibility of Applescript App?


  • Subject: Determining accessibility of Applescript App?
  • From: Brian Christmas <email@hidden>
  • Date: Tue, 30 Aug 2016 17:00:05 +1000

G’day scripters.

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.

Regards

Santa

  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



 _______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden

  • Follow-Ups:
    • Re: Determining accessibility of Applescript App?
      • From: Bill Cheeseman <email@hidden>
  • Prev by Date: Re: "where its" vs "whose"
  • Next by Date: Re: "where its" vs "whose"
  • Previous by thread: Re: Exiting an app with an infinite loop?
  • Next by thread: Re: Determining accessibility of Applescript App?
  • Index(es):
    • Date
    • Thread