+// AEODoc Calls MacOpenURL on the url passed
+
+short wxApp::MacHandleAEGURL(const WXEVENTREF event, WXEVENTREF WXUNUSED(reply))
+{
+ DescType returnedType;
+ Size actualSize;
+ char url[255];
+ OSErr err = AEGetParamPtr((AppleEvent *)event, keyDirectObject, typeChar,
+ &returnedType, url, sizeof(url)-1,
+ &actualSize);
+ if (err != noErr)
+ return err;
+
+ url[actualSize] = '\0'; // Terminate the C string
+
+ ProcessSerialNumber PSN ;
+ PSN.highLongOfPSN = 0 ;
+ PSN.lowLongOfPSN = kCurrentProcess ;
+ SetFrontProcess( &PSN ) ;
+
+ MacOpenURL(wxString(url, wxConvUTF8));
+
+ return noErr;
+}
+