Discussion:
MacOSX-dev Digest, Vol 91, Issue 6
George Warner
2011-07-25 19:48:47 UTC
Permalink
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
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—specifically AEDebug, AEDebugVerbose, AEDebugOSL, AEDebugFlattenedEvents, and AEDebugFile—are 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:

• Creating the file /var/tmp/AEDebugFull is equivalent to setting the AEDebug, AEDebugSends, AEDebugReceives, AEDebugVerbose, AEDebugOSL, and AEDebugFlattenedEvents environment variables.
• Creating the file /var/tmp/AEDebug.out is equivalent to setting AEDebugFile to "/var/tmp/AEDebug.out".
• 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! ;-)
--
Enjoy,
George Warner
Schizophrenic Optimization Scientist
Apple Developer Technical Support (DTS)
eMail: <***@apple.com>
iChat: <***@mac.com>
John Hawkinson
2011-07-25 19:57:48 UTC
Permalink
Post by George Warner
I've always used the AppleEvent tips from Technical Note TN2124,
"Mac OS X Debugging Magic"
*jawdrop*

It's baaaaack!

(Maybe it was there all along on the iOS side of the world, but when I
went looking to confirm TN2124 didn't exist before posting a reference
to it, the Mac version certainly wasn't there this morning, having
been missing for a few months. And it's back now. Hooray!)

--***@mit.edu
John Hawkinson

Loading...