• 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
Re: Accessibility Error Message
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Accessibility Error Message


  • Subject: Re: Accessibility Error Message
  • From: Shane Stanley <email@hidden>
  • Date: Fri, 06 Nov 2015 11:41:37 +1100

On 6 Nov 2015, at 11:01 AM, Jon Rosen <email@hidden> wrote:
>
> Some users (using Yosemite and El Capitan) are getting an error message saying that accessibility needs to be enabled when trying to run certain scripts. However, I made sure that the applications involved are checked in the Privacy/Accessibility pane in Security preferences. I’ve even added System Events, although I don’t think that is necessary. Where else would accessibility need to be enabled?

I suspect the problem you're seeing relates to the fact that every time you run a script, the actual file usually gets updated on disk. Because the code is modified, the system again asks the user to allow access. The solution is to stop the script file being modified each time.

If it's a .scpt file, you can do that like this:

 	set theScript to choose file of type {"scpt"}
	do shell script "chmod a-w " & quoted form of (POSIX path of theScript)

If it's an applet, use this:

 	set thePath to choose file of type {"app"}
	set thePath to (POSIX path of thePath) & "/Contents/Resources/Scripts/main.scpt"
	do shell script "chmod a-w " & quoted form of thePath

But make sure you do it on a copy; you won't be able to edit the resulting script/app. And be aware that this means you can no longer rely on property values being persistent; you will need to store any values you want to persist yourself.

--
Shane Stanley <email@hidden>
<www.macosxautomation.com/applescript/apps/>


 _______________________________________________
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


References: 
 >Accessibility Error Message (From: Jon Rosen <email@hidden>)

  • Prev by Date: Accessibility Error Message
  • Next by Date: Re: Calendar - the big hangover
  • Previous by thread: Accessibility Error Message
  • Next by thread: Please Turn on Accessibility from the Control Panel?
  • Index(es):
    • Date
    • Thread