Error "Not authorized to send Apple events to Messages"

Posted on
Mon Feb 17, 2020 5:30 pm
dsds offline
Posts: 8
Joined: Mar 01, 2015

Error "Not authorized to send Apple events to Messages"

Hi,

I just installed and setup this plugin on Catalina, but am encountering the following error when trying to send a message:

Screen Shot 2020-02-17 at 2.40.38 AM.png
messages error
Screen Shot 2020-02-17 at 2.40.38 AM.png (20.34 KiB) Viewed 6092 times


I've already enabled Full Disk Access permission, so I'm not sure what could be responsible.

Screen Shot 2020-02-17 at 2.40.07 AM.png
Full Disk Access
Screen Shot 2020-02-17 at 2.40.07 AM.png (77.84 KiB) Viewed 6092 times


Any advice would be appreciated.

Thanks!

Posted on
Mon Feb 17, 2020 6:06 pm
jay (support) offline
Site Admin
User avatar
Posts: 18199
Joined: Mar 19, 2008
Location: Austin, Texas

Re: Error "Not authorized to send Apple events to Messages"

None of those are necessary. You might have to add the iMessages plugin though (I don't use it myself so I don't know if that'll work). I don't expect adding full disk access will make it work however since the error implies that it can't send AppleEvents (not access the disk).

Apple has now officially gone off the deep end (what Windows did years ago) when it comes to "security". I suppose their theory is that if the user can't do anything useful then the system is inherently "secure". Might as well just turn off the network, disconnect the keyboard and monitor... :( :? :cry:

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Posted on
Mon Feb 17, 2020 6:32 pm
matt (support) offline
Site Admin
User avatar
Posts: 21411
Joined: Jan 27, 2003
Location: Texas

Re: Error "Not authorized to send Apple events to Messages"

Are you using Indigo 7.4.1?

Image

Posted on
Mon Feb 17, 2020 6:52 pm
GlennNZ offline
User avatar
Posts: 1555
Joined: Dec 07, 2014
Location: Central Coast, Australia

Re: Error "Not authorized to send Apple events to Messages"

Hi all,

https://applehelpwriter.com/2018/09/24/ ... le-events/

The above seems relevant to me, which suggests allowing full disk access to the correct apps (double check version as per Matt's post) would be the way to resolve.


Glenn

Posted on
Mon Feb 17, 2020 7:02 pm
matt (support) offline
Site Admin
User avatar
Posts: 21411
Joined: Jan 27, 2003
Location: Texas

Re: Error "Not authorized to send Apple events to Messages"

Yes, definitely try the Terminal command (mentioned in that article) to reset the permissions then try having the plugin command the Messages app (to send a message I guess).

Code: Select all
tccutil reset AppleEvents; tccutil reset SystemPolicyAllFiles

Image

Posted on
Mon Feb 17, 2020 9:46 pm
dsds offline
Posts: 8
Joined: Mar 01, 2015

Re: Error "Not authorized to send Apple events to Messages"

Thanks for the replies.

I'm running Indigo 7.4.1 and Catalina 10.15.3. I reset my permissions with the terminal command, but it didn't make any difference.

I think the first time it's run it should prompt me to allow access to Messages, but I never see the system dialog window pop up.

Are you guys currently running Catalina yourselves?

Thx.

Posted on
Mon Feb 17, 2020 10:43 pm
matt (support) offline
Site Admin
User avatar
Posts: 21411
Joined: Jan 27, 2003
Location: Texas

Re: Error "Not authorized to send Apple events to Messages"

I tested Catalina with a plugin that use the applescript module to commands Music/iTunes. It worked. It was a while ago, but I believe I got the macOS prompt to allow it the first time it tried to send the message to Music. I didn't try it with Messages.

Image

Posted on
Mon Mar 02, 2020 3:18 pm
Andreas offline
Posts: 19
Joined: Nov 24, 2017

Re: Error "Not authorized to send Apple events to Messages"

Hi, I am facing the same issue.:

iMessage Plugin Debug A error of type :ScriptError occured. The longer message is :Not authorized to send Apple events to Messages.
iMessage Plugin Error An Error occured within the iMsg AppleScript component - ScriptError
iMessage Plugin Error The Error was :Not authorized to send Apple events to Messages. (-1743) app=u'Messages' range=99-101
iMessage Plugin Debug A error of type :ScriptError occured. The longer message is :Not authorized to send Apple events to Messages.
iMessage Plugin Error An Error occured within the iMsg AppleScript component - ScriptError
iMessage Plugin Error The Error was :Not authorized to send Apple events to Messages. (-1743) app=u'Messages' range=99-101

I just migrated to Indigo 7.4.1 and changed to a new Mac with Catalina. It worked without problems before (7.3.1 on El Capitan).

Running the tccutil command and reboot did not help.

The OS X account that runs Indigo does not have admin privileges.

Andreas

Posted on
Mon Mar 02, 2020 3:25 pm
Andreas offline
Posts: 19
Joined: Nov 24, 2017

Re: Error "Not authorized to send Apple events to Messages"

... and granting admin privileges to the OS X account does not help either...

Andreas

Posted on
Tue Mar 03, 2020 10:14 am
Woetjes offline
Posts: 117
Joined: Apr 04, 2016
Location: Belgium

Re: Error "Not authorized to send Apple events to Messages"

Same issue here :cry:

I'm trying to control the Spotify/Music app with an AppleScript through Python from Indigo 7.4.1 on Catalina (the script was working on El Capitan).
If I run a standalone Python script from terminal, I get the security popup message where I need to allow communication between terminal & Spotify.
Running the same script from the Indigo server, I get the 'ScriptError: Not authorized to send Apple events to Spotify.' error message and the popup doesn't appear.

Very very very very annoying issue :(

Posted on
Wed Mar 04, 2020 12:26 pm
matt (support) offline
Site Admin
User avatar
Posts: 21411
Joined: Jan 27, 2003
Location: Texas

Re: Error "Not authorized to send Apple events to Messages"

We will have this macOS bug worked around in the next Indigo release (7.4.2).

Image

Posted on
Sat Mar 07, 2020 4:45 pm
Korey offline
User avatar
Posts: 811
Joined: Jun 04, 2008
Location: Henderson, NV

Re: Error "Not authorized to send Apple events to Messages"

Frack.

I tried the reset all command to get iMessage to work and now my Spotify script no longer functions :cry:

Code: Select all
 Script Error                    Spotify Status.py: Not authorized to send Apple events to Spotify. (-1743) app=u'Spotify' range=55-67
   Script Error                    Exception Traceback (most recent call shown last):



I added plugin host and indigo server into the full access permissions but still no luck.

Anyone know what files I need to pull from my backup to fix the wipe?
Code: Select all
tccutil reset AppleEvents; tccutil reset SystemPolicyAllFiles


This is the script BTW (set to run every 10 seconds)
Code: Select all
import applescript

spotifyScript = '''
tell application "Spotify"
  set strState to (get player state) as string
  set strTrack to (get name of current track) as string
  set strArtist to (get artist of current track) as string
  set strAlbum to (get album of current track) as string
end tell
set blnPlaying to (strState is equal to "playing" or strState is equal to "paused")
set returnRec to {SpotifyPlayerState:strState}
set returnRec to returnRec & {SpotifyIsPlaying:blnPlaying as string}
if (blnPlaying) then
   set returnRec to returnRec & {CurrentArtist:strArtist}
   set returnRec to returnRec & {CurrentAlbum:strAlbum}
   set returnRec to returnRec & {CurrentTrack:strTrack}
end if

return returnRec
'''

a_script = applescript.AppleScript(source=spotifyScript)
reply = a_script.run()

for var_name, value in reply.items():
    indigo.variable.updateValue(str(var_name), value=value)


OSX 10.14.6
Indigo 7.4.1

--
Korey

Posted on
Sat Mar 07, 2020 6:03 pm
matt (support) offline
Site Admin
User avatar
Posts: 21411
Joined: Jan 27, 2003
Location: Texas

Re: Error "Not authorized to send Apple events to Messages"

I believe we have a solution to workaround this bug in the next version of Indigo.

In the mean time you can try this other workaround I found. Open the Script Editor application and create a new script file that has one of the following snips (depending on the app you're trying to control):

Code: Select all
tell application "Messages"
   name of every buddy
end tell


Code: Select all
tell application "Spotify"
   sound volume
end tell


Code: Select all
tell application "iTunes"
   sound volume
end tell


Code: Select all
tell application "Music"
   sound volume
end tell


Then save that as an .scpt file. Next create an Action Group in Indigo that executes that script file. Execute the Action Group and with any luck macOS will prompt you to allow it. Once you accept that then your other python script file should start to execute without being blocked (and you can delete the Action Group and .scp file).

Image

Posted on
Sat Mar 07, 2020 7:14 pm
Korey offline
User avatar
Posts: 811
Joined: Jun 04, 2008
Location: Henderson, NV

Re: Error "Not authorized to send Apple events to Messages"

matt (support) wrote:
I believe we have a solution to workaround this bug in the next version of Indigo..


Thanks Matt, I ended up restoring from my nightly backup with SuperDuper! using the "Copy Different Files" option.

I'm back in action. :D

That Spotify script is critical for WAF in my installation :) :)

--
Korey

Posted on
Sun May 24, 2020 8:18 am
MarcoGT offline
Posts: 1091
Joined: Sep 11, 2014
Location: Germany

Re: Error "Not authorized to send Apple events to Messages"

Full Disk Access to Messages does not help...any other idea?

Who is online

Users browsing this forum: No registered users and 1 guest