site_archiver@lists.apple.com Delivered-To: pro-apps-dev@lists.apple.com Best luck, Helena On Sep 17, 2008, at 4:05 PM, Tommy Schell wrote: Thanks for the reply. ************************ the event struct: struct apple_fcp_event { AppleEvent theEvent; AppleEvent theReplyEvent; AEAddressDesc appAddr; AEDescList paramList; OSStatus err; } my_event; ************************ initializing code: // init event struct AECreateDesc(typeNull, NULL, 0, &(my_event.appAddr)); AECreateDesc(typeNull, NULL, 0, &(my_event.theEvent)); AECreateDesc(typeNull, NULL, 0, &(my_event.theReplyEvent)); AECreateList(NULL, 0, false, &(my_event.paramList)); ************************ // create event like so: // create_event (kAEFCPOpenProjectFile); void create_event (OSType eventType) { OSType my_class = kFCPEventClass; } } ************************ // add a project file like so: // CFStringRef x = CFSTR ( "/Users/tommyschell/myfoo.fcp"); // assign_project_file ( x ) ; FSRef fileFSRef; CFURLRef ref; } ************************ // send event ************************ // clean up void clean_up_event () { // clean up AEDisposeDesc(&(my_event.paramList) ); AEDisposeDesc(&(my_event.theReplyEvent) ); AEDisposeDesc(&(my_event.theEvent) ); AEDisposeDesc(&(my_event.appAddr) ); } Can't get FCP to act, though it returns noErr. Any ideas? Thanks, Tommy Schell On Sep 16, 2008, at 10:28 AM, Darrin Cardani wrote: On Sep 16, 2008, at 9:02 AM, Tommy Schell wrote: Can Final Cut Pro Apple events be used in Carbon? Darrin -- Darrin Cardani dcardani@apple.com _______________________________________________ Do not post admin requests to the list. They will be ignored. Pro-apps-dev mailing list (Pro-apps-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/pro-apps-dev/hju%40apple.com _______________________________________________ Do not post admin requests to the list. They will be ignored. Pro-apps-dev mailing list (Pro-apps-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/pro-apps-dev/site_archiver%40lists.ap... Hi Tommy, The following link has a description of how to turn on Apple Event Logging to see what is going wrong: http://developer.apple.com/documentation/AppleScript/Conceptual/AppleEvents/... I think I also found a problem in your event creation (noted in-line below) I actually appear to get an error value of noErr from my AESend call, but nothing happens in Final Cut. If I do the same action from the sample code FinalCutPro_AppleEvents (an attempt to open a project), it opens no problem. So in my Carbon code (which is actually a jni lib with a java interface), I've extracted some code from the Cocoa sample FinalCutPro_AppleEvents: (which, again, results in noErr from AESend but nothing happens) // create open project event if (my_event.err == noErr) { my_event.err = AECreateDesc(typeApplSignature, &my_class, sizeof(OSType), &(my_event.appAddr) ); } if (my_event.err == noErr) { my_event.err = AECreateAppleEvent(eventType, kFCPEventClass, &(my_event.appAddr) , kAutoGenerateReturnID, kAnyTransactionID, &(my_event.theEvent) ); I think this should be: my_event.err = AECreateAppleEvent(my_class , eventType, &(my_event.appAddr) , kAutoGenerateReturnID, kAnyTransactionID, &(my_event.theEvent) ); // pass in a posix style path (relative or absolute i think), converted to url then fsref void assign_project_file ( CFStringRef path) { ref = CFURLCreateWithFileSystemPath(NULL, (CFStringRef)path, kCFURLPOSIXPathStyle, false); if (CFURLGetFSRef(ref, &fileFSRef)) { my_event.err = AEPutParamPtr(&(my_event.theEvent) , kFCPProjectFileKey, typeFSRef, &fileFSRef, sizeof(FSRef)); } // ship it if (my_event.err == noErr) { my_event.err = AESend(&(my_event.theEvent), &(my_event.theReplyEvent), kAEWaitReply, kAEHighPriority, kAEDefaultTimeout, NULL, NULL); } I can't seem to get FCP to respond from Carbon code. I extracted the necessary code from the Cocoa sample FinalCutPro_AppleEvents over to Carbon but now it doesn't work. Yes, FCP Apple Events can be used in Carbon. The OS shouldn't care what libraries a given app links against when using Apple Events. You might want to post a snippet of code and what error values you're getting back. This email sent to hju@apple.com This email sent to site_archiver@lists.apple.com