+
+ for (i = 1; i <= itemsInList; i++) {
+ AEGetNthPtr(&docList, i, typeFSS, &keywd, &returnedType,
+ (Ptr) & theSpec, sizeof(theSpec), &actualSize);
+ wxString fName = wxMacFSSpec2MacFilename(&theSpec);
+ MacOpenFile(fName);
+ }
+ return noErr;
+}
+
+short wxApp::MacHandleAEPDoc(const WXEVENTREF event , WXEVENTREF WXUNUSED(reply))
+{
+ AEDescList docList;
+ AEKeyword keywd;
+ DescType returnedType;
+ Size actualSize;
+ long itemsInList;
+ FSSpec theSpec;
+ OSErr err;
+ short i;
+ err = AEGetParamDesc((AppleEvent *)event, keyDirectObject, typeAEList,&docList);
+ if (err != noErr)
+ return err;
+
+ err = AECountItems(&docList, &itemsInList);
+ if (err != noErr)
+ return err;
+
+ ProcessSerialNumber PSN ;
+ PSN.highLongOfPSN = 0 ;
+ PSN.lowLongOfPSN = kCurrentProcess ;
+ SetFrontProcess( &PSN ) ;
+
+ for (i = 1; i <= itemsInList; i++) {
+ AEGetNthPtr(&docList, i, typeFSS, &keywd, &returnedType,
+ (Ptr) & theSpec, sizeof(theSpec), &actualSize);
+ wxString fName = wxMacFSSpec2MacFilename(&theSpec);
+ MacPrintFile(fName);
+ }
+ return noErr;