Allow remote Apple events on Mac
Your Mac can accept Apple events from apps running on other computers. An Apple event is a task being performed on a Mac, such as “open this document” or “print.”
With remote Apple events turned on, an AppleScript program running on another Mac can interact with your Mac. For example, the program could open and print a document that’s located on your Mac.
On your Mac, choose Apple menu > System Settings, click General in the sidebar, then click Sharing on the right. (You may need to scroll down.)
Turn on Remote Apple Events, then click the Info button on the right.
Specify who can send events:
All users: Any of your computer’s users and anyone on your network can send events.
Only these users: Click the Add button , then choose who can send events. Users & Groups includes all the users of your computer. Network Users and Network Groups include people on your network.