I just read in this article about AppleEvents, but cannot find any examples etc.
How to use AppleScript in macOS
It says:
At an even lower level is another Apple technology called AppleEvents (AE). AppleEvents are an Inter-Application Communication (IAC) facility which allows apps and processes to communicate with each other.
AppleEvents usually have a four-character code for the class, or suite of events, then another four-character code for the event type itself. By sending and receiving AppleEvents, macOS apps can trigger each other to perform certain actions.
AppleScript is based on AppleEvents and uses the IAC mechanism to transport messages and data around the system.
I have two scripts which open two separate Numbers documents and coordinate activities. Presently I am using a table in a SQLite database to store semaphores and messages shared between the two scripts to control actions. Basically one of the scripts runs in the background with idle loops (using delay commands) but it would seem far more efficient if there was direct interprocess communication or a way to have the background script simply sit idle (no delay timed loops) until âwokenâ up by the control script.
I tried to find an AppleEvents dictionary but no luck only System Events, very cryptic.
Any ideas?