Allow remote application scripting 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 application scripting 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 Application Scripting, then click the Info button on the right.
Click the “Allow access for” pop-up menu, then do one of the following:
Let everyone send Apple events to your computer: Click the pop-up menu next to “Allow access for,” then choose “All users.”
Choose who can send Apple events to your computer: Click the pop-up menu next to “Allow access for,” choose “Only these users,” click the Add button at the bottom of the list, select users who can send Apple events, then click Select.
Users & Groups includes all the users of your Mac. Network Users and Network Groups include people on your network.
To remove a user from the list, select the user, then click the Remove button .
Click Done.