Developer: The founder and main developer is Nigel Garvey, who is highly respected for his deep knowledge of AppleScript and macOS inter-process communication.
Product Line:
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.
AE Monitor is part of a collection of tools called AE Gizmos, which includes:
AE Monitor: For monitoring Apple Events live.
AE Tester: For sending custom Apple Events to applications.
AEBuild / AEDebugger: Command-line utilities for working with Apple Event descriptors.
These tools are invaluable for developers, scripters, and advanced users who want to understand or debug how apps communicate via Apple Events — the technology behind AppleScript, Scripting Bridge, and many forms of macOS automation.
License & Cost
AE Gizmos (including AE Monitor) is free for personal use.
Commercial licenses or support options may be available — check their website for details.
If you're interested in macOS automation, debugging AppleScript, or reverse-engineering app scripting support, AE Monitor is considered one of the best tools available.
User
What are the AEBuild / AEDebugger Command-line utilities
Assistant
AEBuild and AEDebugger are powerful command-line tools included in the AE Gizmos package by Late Night Software. These utilities allow developers and advanced users to work directly with Apple Events — the core inter-process communication mechanism on macOS that underpins AppleScript, Scripting Bridge, and many automation workflows.
Let’s break down each tool:
🔧 1. aebuild
What it does:
aebuild is a command-line utility used to construct Apple Event descriptors (AEDescs) from human-readable text input. It allows you to build complex Apple Event structures using a custom syntax, then send those events to target applications.
This is especially useful for testing or scripting apps that support AppleScript or other Apple Event-based interfaces — even if they don’t expose a full scripting dictionary.
Use Cases:
Send raw Apple Events to an app to simulate what AppleScript would do.
Test how an app responds to specific commands or parameters.
Automate tasks that aren't easily accessible via AppleScript or JavaScript for Automation.
This sends an Open Document ('aevt'/'odoc') Apple Event to the target application with a file URL as the direct object.
Flags:
Some common flags:
-t: Target application (e.g., com.apple.TextEdit)
-e: The Apple Event expression written in AEBuild syntax
-v: Verbose output
-n: Dry run (don’t send the event)
Why It's Useful:
You can use aebuild to test obscure or undocumented Apple Event commands, bypass limitations of AppleScript or JXA, and interact more directly with the system-level IPC mechanisms macOS uses.
🐛 2. aedebugger
What it does:
User
I am writing Swift code in Xcode using ScriptingBridge, I want to be able to review the raw Apple Event that is being sent and received by another application that is scriptable, as well as the return from the other application. How can I do this using modern macOS development tools, either in the terminal or a specific tool that exists. Software by Late Night Software and Oxalyn Software have been discontinued.
Assistant
You're working with ScriptingBridge in Swift (Xcode), and you want to see the raw Apple Events being sent to and received from a scriptable macOS application, along with any return values.
This is a very common need when debugging automation or reverse-engineering scripting support — especially since ScriptingBridge generates code based on an app’s scripting definition (sdef) and abstracts away the low-level Apple Event details.
🧾 Summary of Your Goal
You're using ScriptingBridge in Xcode (Swift).
You want to monitor raw Apple Events going to and coming from another application.
You want to see both the outgoing event and the reply.
You're aware that tools like AE Monitor, AEBuild, etc., exist, but you're looking for modern solutions (e.g. compatible with macOS 12+ and not dependent on discontinued software).
✅ Best Modern Methods to Monitor Raw Apple Events
Since you're developing in Swift/Xcode, and you want visibility into Apple Event traffic, here are your best options:
🔹 1. Use Environment Variables to Log Apple Events (✅ Recommended)
This is the most direct method to log all Apple Events sent and received by a target application — including those triggered via ScriptingBridge.
✅ Works With:
Any app that uses the Apple Event Manager (which includes all apps supporting AppleScript/ScriptingBridge)
No third-party tools required
Works on modern macOS versions (including Sonoma)
📌 How It Works:
macOS has hidden environment variables that enable logging of Apple Events at a low level:
AEDebugSends: Logs outgoing Apple Events
AEDebugReceives: Logs incoming Apple Events
AEDebug: General logging flag
AEDebugLevel: Controls verbosity
These are not documented officially, but they’ve been used by developers and reverse engineers for years.
🛠️ Step-by-Step Instructions
1. Find the App's Executable Path
Example: For TextEdit:
bash
ls /System/Applications/TextEdit.app/Contents/MacOS/
You'll get something like:
User
Getting alert 'TextEdit quit unexpectedly.' when using 'AEDebugSends=1 AEDebugReceives=1 AEDebug=1 AEDebugLevel=3 /System/Applications/TextEdit.app/Contents/MacOS/TextEdit'. What would cause this?
Assistant
Great question — it's not uncommon to encounter crashes when enabling Apple Event debugging with environment variables like AEDebugSends=1, especially on modern macOS versions (macOS 12+).
You're effectively turning on Apple Event logging at a very low level, which causes the system to log every Apple Event sent or received by the application. However, some apps — particularly system apps like TextEdit, Preview, or even Finder — may not be designed to handle this extra logging overhead, or may have code paths that crash when these debug flags are active.
🧨 Common Causes of the Crash
Incompatible with Hardened Runtime / System Integrity Protection (SIP):
System apps like TextEdit run under strict sandboxing and hardened runtime protections.
The internal Apple Event logging system (AEDebug*) predates modern macOS security hardening and may cause unexpected behavior in signed/system apps.
Deprecated Logging Internals:
These environment variables were more stable in older macOS versions (pre-10.15).
In macOS 11+ (Big Sur) and later, many internal APIs and logging behaviors changed due to Apple’s shift to Unified Logging and stricter process control.
Memory Corruption or Assertion Failure:
Some apps may internally assert or fail silently when they detect debug logging is enabled.
If the app attempts to log something it normally wouldn’t (like private data), it might trigger a crash.
No Debug Symbols or Logging Support Built In:
Unlike developer apps or scripting hosts (like Script Editor or third-party apps), TextEdit may not be built with full support for verbose Apple Event logging.
When forced, it can result in memory access violations or other undefined behavior.
✅ Workarounds and Alternatives
Here are several strategies to help you still inspect Apple Events, even if TextEdit crashes when launched this way.
aedebugger is a command-line tool that lets you inspect and manipulate Apple Event descriptors, including dumping their structure, extracting data, or modifying them before sending.
It’s like a hex editor or packet sniffer but for Apple Events.
Use Cases:
Inspect Apple Events captured from AEDebugSends or AEDebugReceives logs.
Save and replay Apple Events for debugging or automation.
Understand the internal structure of AEDescs.
Modify and resend Apple Events during testing.
Syntax Example:
If you save a raw Apple Event descriptor to a file (say, event.ae), you can inspect it:
bash
aedebugger dump event.ae
Or, to extract a specific part of the descriptor:
bash
aedebugger extract --key '----' event.ae
Flags:
Some useful flags:
dump: Show the full contents of an AEDesc.
extract: Pull out a specific key or descriptor.
send: Send a saved AEDesc to a target app.
save: Save a modified descriptor back to disk.
Why It's Useful:
aedebugger helps reverse engineer Apple Events you've captured from logs or monitoring tools like AE Monitor. You can analyze exactly what data was sent or received, tweak it, and re-inject it into the system.
🧰 Installation
Both tools come bundled in the AE Gizmos package, available from:
However, this often redacts data due to privacy protections unless you install a special profile or run in Developer Mode.
🔹 2. Use DTrace or sysdiagnose (Advanced)
If you're comfortable with system tracing tools, you can use DTrace or sysdiagnose to capture Apple Event-related calls.
Example DTrace Script (simplified):
d
#pragma D option quiet
BEGIN {
last = timestamp;
}
syscall::bsd_sendmsg:entry,
syscall::bsd_recvmsg:entry
/execname == "TextEdit"/ {
printf("Timestamp: %Y", walltimestamp);
printf("Process: %s (%d)", execname, pid);
printf("Syscall: %s", probefunc);
}
But DTrace doesn't show the content of Apple Events directly — only that some IPC happened.
🔹 3. Use Accessibility Inspector (Limited)
Accessibility Inspector (part of Xcode) lets you inspect UI elements and some scripting info, but does not show Apple Events directly.
Useful for understanding what UI/scripting elements are exposed, but not for seeing events themselves.
🔹 4. Use osascript with -l Flag (Debugging Tool)
The built-in osascript command has a -l flag which logs Apple Events sent during execution:
bash
osascript -l -e 'tell application "TextEdit" to open "/Users/user/test.txt"'
This gives you a breakdown of the Apple Events sent and received. While not directly related to ScriptingBridge, it helps validate expected behavior.
🧪 Bonus: Using aebuild and aedebugger (Still Available!)
Although AE Gizmos were previously hosted on Late Night Software, they have now moved to https://github.com/dokterdok/AE-Gizmos, maintained by the community.
They work great on modern macOS versions and allow you to:
Build and send custom Apple Events (aebuild)
Inspect and replay Apple Events (aedebugger)
Install them via:
bash
brew install --cask ae-gizmos
(Requires Homebrew Cask)
🧑💻 In Your Xcode Workflow
To integrate this into your development cycle:
Run the target app from Terminal with debug flags.
Run your Swift app from Xcode.
Watch Terminal for Apple Event logs.
Optionally save logs for analysis or replay using aedebugger.
🧾 Summary Table
Method
Tool
Raw Detail
Live Monitoring
Notes
Environment Variables
Terminal
✅ Highest
✅ Yes
Must launch app manually
log stream
Terminal
❌ Medium
✅ Yes
Often redacts data
osascript -l
Terminal
✅ Good
✅ Yes
For testing AppleScript equivalents
aebuild/aedebugger
Terminal
✅ High
❌ No
For building/replaying events
DTrace/sysdiagnose
Terminal
❌ Low
✅ Yes
Complex; shows system activity, not content
Accessibility Inspector
Xcode
❌ None
❌ No
Not for Apple Event inspection
✅ Final Recommendation
To monitor raw Apple Events sent and received by another application while using ScriptingBridge in Xcode, the best approach is:
Launch the target app from Terminal with AEDebugSends=1 AEDebugReceives=1 and observe the logs.
This is the most reliable, built-in way to get exactly what you're asking for without relying on third-party tools or outdated software.
Let me know if you'd like help writing a small Swift ScriptingBridge demo and capturing its Apple Events live!
🔹 1. Try With a Third-Party App Instead
Try launching a third-party scriptable app instead of a system one. For example:
Then use aedebugger to analyze any saved responses or descriptors.
🔹 5. Build Your Own Test App Using ScriptingBridge
Instead of trying to debug TextEdit directly, build a simple test app in Xcode using ScriptingBridge that talks to another target app (like Safari or BBEdit). Then monitor the target app with log stream or by launching it manually with AEDebug flags.
This gives you full control over both sender and receiver.
🔹 6. Use DTrace to Trace Mach IPC (Advanced)
If you're comfortable with low-level tracing, you can trace inter-process communication related to Apple Events:
#pragma D option quiet
BEGIN {}
syscall::bsd_mach_msg:entry /execname == "TextEdit"/ {
printf("PID %d sending/receiving Mach message", pid);
}
Again, this won't show the actual Apple Event content but helps identify when communication happens.
🧪 Bonus: Try Launching via launchd or Background Task
Sometimes apps behave differently when launched from Terminal vs. background contexts. You could try wrapping the command in a .plist and loading it via launchd. This isn't guaranteed to help, but it's worth testing.
✅ Summary
Cause
Description
Hardened Runtime / SIP
System apps like TextEdit may crash when debug logging is enabled.
Outdated Debug Internals
AEDebug* was more reliable pre-macOS 11.
No Logging Support Built In
Some apps aren't compiled with support for verbose Apple Event logging.
🛠️ Recommended Fix
Since TextEdit crashes with AEDebug*, here's what to do:
Test with a third-party app (e.g., BBEdit)
Use log stream to monitor Apple Events without relaunching
Enable Developer Mode to reduce log redaction
Optionally use aebuild and aedebugger to simulate and inspect Apple Events manually
Would you like a sample Swift/Xcode project using ScriptingBridge that connects to a known-good target app like Safari or BBEdit, so you can see how Apple Events work end-to-end?