What is AE Server Mac
Moving between different Macs to complete simple tasks can be a hassle. For instance, printing a document on a different Mac requires copying the file to your computer, logging into the other Mac, and then printing it from there. This is often necessary when the file can’t be opened on your Mac or the required app is outdated.
Copying the file to another computer is too troublesome, especially if it involves a lot of files. Fortunately, Apple has made it easier to control another Mac on the same network using AppleScripts and Remote Apple Events. Thanks to these technologies, Mac users can now access, launch apps, and perform basic tasks remotely. Users don’t have to get up from their seats just to listen to iTunes, send a message using the Messages app, or send an email to contact.
Remote access is useful if you have two or more Macs at home or in the office. Although you can remotely control another Mac on the same network using the Shared feature, using AppleScript commands and the AE Server is a lot faster. Plus, you don’t need to open the Shared screen feature to do so.
What is Apple Event?
Apple events are the message-based interprocess communication mechanism in Mac OS, first making an appearance in System 7 and supported by every version of the classic Mac OS since then and by macOS. Apple events describe “high-level” events such as “open document” or “print file”, whereas earlier OSs had supported much more basic events, namely “click” and “keypress”. Apple events form the basis of the Mac OS scripting system, the Open Scripting Architecture (the primary language of such being AppleScript).
Pro Tip: Scan your Mac for performance issues, junk files, harmful apps, and security threats
that can cause system issues or slow performance.
Special offer. About Outbyte, uninstall instructions, EULA, Privacy Policy.
The starting point is a dynamically-typed, extensible descriptor format called an AEDesc, which is just an OSType code specifying the data type, together with a block of type-dependent data. For instance, the OSType code inte indicates that the data was a four-byte signed integer in big-endian format.
Besides predefined type codes for various common simple types, there are two predefined structured descriptor types: an AERecord, which has data type reco (record), and AEList with type list (list or array). The internal structure of these contain recursively-nested AEDescs, while the AERecord also associates each element with a unique record field ID, which is an OSType. The Apple Event Manager provides API calls to construct these structures, as well as extract their contents and query the type of contents they hold.
The Apple Event Manager also supports coercions, which converts AEDescs from one data type to another. In addition to standard coercions, for instance between integer and real types, applications can install their own coercion handler callbacks, which handle conversions to and from custom data types.
An Apple event proper is an AERecord with fields that depended on the purpose of the event. In addition, it has attributes (which are distinct from record fields, which are now called the parameters of the event) from a set predefined by the Apple Event Manager. These specify what the event is supposed to do (through event class and event ID), the target address to which the event is to be sent (which could be a process on the local or a remote machine), and various other options for handling it. Remote machines initially had to be connected via AppleTalk, but Mac OS 9 added the option for connections via TCP/IP.
After sending an Apple event to its target process, the sending process can elect to receive a reply Apple event. This can contain various bits of information returned from the target about the processing of the original event, including an error code indicating success/failure, any information requested by the original event, and/or other appropriate information.
Apple events are the foundation of the AppleEvent Object Model, which in turn is the foundation of the OSA and AppleScript. As of 2016, the official implementation of the Apple Event Manager API is available in C and its descendants, including C++. Official bindings are also provided for Objective-C and Swift through the Cocoa API. Unofficial bindings also exist for other languages (with varying degrees of limitation), including Perl, UserTalk, Ruby and Python.
What is the AE Server?
If you’ve noticed the AE Server running in the background and you’re not familiar with this feature, you’re probably asking yourself: what is the AE server on my Mac?
The AE Server, also known as the AppleEvents Server, handles the Remote Apple Events on macOS. This enables applications on other Macs to send AEs to the local computer. Check System Preferences > Sharing to see whether Remote Apple Events is turned on. You can access the AEServer in the macOS Accessibility permissions panel:
System Preferences > Security & Privacy > Privacy > Accessibility > AEServer
This might seem complicated, but it is actually a lot simpler than it sounds. The AppleScript, which is the built-in user-level scripting system on macOS, allows Mac users to automate repetitive tasks, extend the apps’ abilities, and even create stand-alone apps using a relatively simple language. The AppleScript communicates with macOS and the target individual applications using a simple messaging system called Apple Events.
What the AE Server does is to receive and execute the AppleScript and send it to it another Mac computer. Sending the AppleScript is not enough to perform the task, it should be approved by the receiving computer through the Remote Apple Events.
Your Mac can accept AEs from applications running on other Mac computers. These are tasks being performed on macOS, such as open this document or print this document. With Remote Apple Events switched on, an AppleScript running on another Mac can remotely control your local Mac or perform tasks, such as printing documents or opening applications.
For Macs running on macOS Catalina, AppleEvents and AppleScripts that target a program on a remote system should be authenticated by the same user on that remote system. Otherwise, the user will receive a procNotFound error. To allow remote AppleEvents to target apps in any user session, run the following command in Terminal on the server:
defaults write /Library/Preferences/com.apple.AEServer RestrictAccessToUserSession -bool false
Then disable and reenable Remote Apple Events in System Preferences > Sharing.
What is the Apple Event Manager?
The Apple Event Manager, a part of the Open Scripting Architecture (OSA), provides facilities for applications to send and respond to Apple events and to make their operations and data available to AppleScript scripts. For related API reference, see Open Scripting Architecture Reference.
An Apple event is a type of interprocess message that can specify complex operations and data. Apple events provide a data transport and event dispatching mechanism that can be used within a single application, between applications on the same computer, and between applications on different computers connected to a network.
Applications typically use Apple events to request services and information from other applications or to provide services and information in response to such requests. All applications that present a graphical interface to the user through the Human Interface Toolbox (Carbon applications) or the Cocoa application framework should be able to respond, if appropriate, to certain events sent by the Mac OS. These include the open application (or launch), reopen, open documents, print documents, and quit events.
Some Apple Event Manager functions are marked as being thread safe—for all other functions, you should call them only on the main thread.
For an overview of technologies that take advantage of the Apple Event Manager, see AppleScript Overview.
For information on working with Apple events, including events sent by the Mac OS, see Responding to Apple Events in Apple Events Programming Guide. For information about individual four-character codes used in Apple events, see AppleScript Terminology and Apple Event Codes Reference.
The Apple Event Manager is implemented by the AE framework, a subframework of the Core Services framework. You don’t link directly with the AE framework—instead, you typically link with the Carbon framework, which includes it. Some AppleEvent definitions are only available to clients of the Carbon framework, which includes, for example, AEInteraction.h in the HIToolbox framework.
The AE framework does not force a connection to the window server. This allows daemons and startup items that work with Apple events to continue working across log outs.
How to 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 Preferences, then click Sharing.
- Select the Remote Apple Events checkbox.
- 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.
How to Enable the AE Server on a Mac
In order to instruct another Mac on your network, you need both AppleScripts and the Remote Apple Server for it to work. The AppleScripts contain the instructions for the task you want the other Mac to perform while the AE Server authorizes and executes the instructions. You can tell another Mac to shut down, play a song, visit a website, or display an alert using these features.
To enable the Remote Apple Server or the AE Server on your Mac, follow these instructions:
- On your Mac or the Mac, you want to remote control, click on the Apple menu, then choose System Preferences.
- Click Sharing, then tick off the Remote Apple Events checkbox.
- Specify the users who can send events:
- All users: Any of the users on your computer and anyone on your network can send events to your Mac.
- Only these users: Click the Add (+) button, then choose the users who can send events. Users & Groups refer to all the users on your computer. Network Users and Network Groups refer to the people on your network.
Once you have followed these steps, the users you specified can now send AppleScripts to your Mac. You will still need to log in using that Mac’s admin username and password to authenticate the AppleScript.
But before running the AppleScript, it’s recommended to clean up your computer first. You can achieve this by using Mac cleaning software, which can help ensure that your computer is performing at its best.
As with all sharing features, you should enable Remote Apple Events only if you’re sure that you need it. A malicious third-party who knows your Mac’s IP address, as well as your username and password, could steal information from your Mac, hijack your device, or override your session. If you don’t need to send instructions to another Mac, it is best to leave this feature disabled to close off all unnecessary avenues of attack.
To disable the Remote Apple Server, you can either turn it off using the Sharing menu (Apple menu > System Preferences > Sharing > Remote Apple Events) or type in the following command using Terminal:
/usr/bin/sudo /bin/launchctl disable system/com.apple.AEServer
Restart your computer for the changes to take effect. Your AE Server should now be disabled.
How to Write AppleScripts
Enabling the Remote Apple Server is just one part of the equation. Next, you need to write the AppleScripts with the instructions of what you want your Mac to do. For this, you need to use the AppleScript Editor or the Script Editor under Finder > Utilities. Once the editor is open, you can then write the script by clicking File > New.
Here are some of the scripts you can try:
- Put Mac to Sleep
tell application “Finder” of machine “eppc://IP Address of the target Mac″
sleep
end tell
- Open iTunes
iTunestell application “iTunes” of machine “eppc://IP Address of the target Mac”
play
end tell
- Quit iTunes
tell application “iTunes” of machine “eppc://IP Address of the target Mac”
stop
end tell
- Launch Safari
tell application “Safari” of machine “eppc://IP Address of the target Mac”
activate
end tell
- Quit Safari
tell application “Safari” of machine “eppc://IP Address of the target Mac”
quit
end tell
Once you have created these AppleScripts, you can save them on your Mac and run them when you need to. You will need to enter the target Mac’s username and password to execute the AppleScript.
I’ve searched for an answer to why AEServer keeps showing up in preferences but could never get a good answer. This site didn’t show up in my searches till I turned off Safari Suggestions plus Java Script and turned on Block All Cookies on my phone. You’ve done a great job explaining it so even someone as slow as me can understand. Thank You
Does an AE Server have anything to do with Webroot not scanning anymore on my iMac Pro?