Re: MacOSX-dev Digest, Vol 91, Issue 6
George Warner <[email protected]> Mon, 25 Jul 2011 12:48:47 -0700
| Newsgroups | gmane.comp.macosx.devel |
|---|---|
| Message-ID | <[email protected]> |
On Jul 25, 2011, at 12:00 PM, [email protected] wrote: > Years ago, I used a technique described in a blog posting at Unsanity = to figure out the appropriate AppleEvent to send to represent a given = AppleScript. That blog entry is here: = http://unsanity.org/archives/000107.php >=20 > I'm wondering if anyone knows how to accomplish the same thing on = Intel-based machines. I'm hopeful that it's a simple matter of replacing = the $r3 register argument with something else but I don't know enough = about modern Intel architectures to know what that might be. I've always used the AppleEvent tips from Technical Note TN2124, "Mac OS = X Debugging Magic" = (@<https://developer.apple.com/library/ios/#technotes/tn2124/_index.html>)= : ..., to log information about AppleEvent manager calls, you can set = environment variables that will produce debugging output to the console: % setenv AEDebugSends 1 # print sent events % setenv AEDebugReceives 1 # print received events and = replies Some environment variables=97specifically AEDebug, AEDebugVerbose, = AEDebugOSL, AEDebugFlattenedEvents, and AEDebugFile=97are only supported = by the debug library. If you are using the debug library, you can also control Apple event = debugging by creating three files in /var/tmp: =95 Creating the file /var/tmp/AEDebugFull is equivalent to = setting the AEDebug, AEDebugSends, AEDebugReceives, AEDebugVerbose, = AEDebugOSL, and AEDebugFlattenedEvents environment variables. =95 Creating the file /var/tmp/AEDebug.out is equivalent to = setting AEDebugFile to "/var/tmp/AEDebug.out". =95 Creating the file /var/tmp/AEDebugLogs causes Apple Event = Manager to send all of its output to a file named = /var/tmp/AELog-<progname>. Important: The last two items only affect the destination of the = debugging output. In order to produce debugging output, you have to = enable it using one of the environment variables listed above, or by = creating /var/tmp/AEDebugFull. If you set the AE_PRINT_XML environment variable to 1 (10.4 and later), = GDBPrintAEDesc will print the descriptor as XML (if possible). Note that the log output can almost be pasted directly into an AEBuild = statement. QED! ;-) --=20 Enjoy, George Warner Schizophrenic Optimization Scientist Apple Developer Technical Support (DTS) eMail: <[email protected]> iChat: <[email protected]>=