[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Object Specifiers in Apple Events



This is a brief question about getting data out of object specifier
descriptor records which come with Apple Events (AE's).

As far as I can tell, the standard way of doing this is to coerce the
object specifier into another object such as an AERecord from which the
data may be easily accessed.

The question is... what if the coersion operation doesn't work but
returns a -1700 error (Data could not be coerced to the requested
descriptor type).

When I send an object specifier record from another LISP program 
(constructed by coercing an AERecord into an ObjectSpecifier), there
are no problems at all coercing it back.  However, when I receive an
AE from a commercial program, in this case Informed Designer, I got
only an error.

Here's a snippet of the code I'm using...  

(setf ae <<Pointer to the AE>>)      ; set ae to point at the AppleEvent
(setf result (make-record :AEDesc))  ; set a variable for result

(#_AEGetParamDesc ae :|----| :|****| result)  ; Get the DirectObject
(rref result :AEDesc.descriptortype)          ; result type = :|obj |

(setf result2 (make-record :AEDesc))     ; set a variable for result
(#_AECoerceDesc result :|reco| result2)  ; coerce it into an AERecord


The last line is the one causing the problems.  Any help would be most
appreciated!  Thanks.

--John
jash@eecs.wsu.edu