"Didn't work" leaves a lot of wiggle room in interpretation. What error is returned in that case? And which AppleEvent routine returned that error?
On Feb 22, 2010, at 9:56 AM, Brad Wright wrote: Hi Eryk:
Yes, I tried to use the example code, but it would not send an XML file to Final Cut Pro. It didn't work and I didn't want to modify the example code. The interesting thing is that the code below works fine with Final Cut Pro 7.0, but in Final Cut Pro 6.0 and 5.0 it asks for a DTD. So the Apple Events are getting sent, but version 5.0 and 6.0 want a DTD. Importing the same XML file rather than sending it, will work with FCP 5.0, FCP 6.0, FCP 7.0. Sending the XML file to 5.0 and 6.0 won't work.
Brad On Feb 22, 2010, at 9:07 AM, Eryk Vershen wrote: I believe Helena was suggesting that you use the sample app to verify that sending the text of your XML worked fine.
I expect your problem is the method XMLData returns an NSData object which contains an NSString. I don't have the text of your sendXML method, but is it extracting the bytes of the contained NSString and attaching them to the event?
Have you tried turning on AppleEvent tracing so you can see what you are actually sending?
regards, -eryk
On Feb 21, 2010, at 9:53 PM, Brad Wright wrote: I can't get the FinalCutPro_AppleEvents sample code to load an XML file and send it to FCP. I'm using the following calls which work in 7.0, but not in FCP 5.1.4. Haven't tried 6.0, but I will try that next.
-(void) sendToFinalCutPro:(NSXMLDocument*) newTreeRoot { apple_event *sendEvent = [[apple_event alloc] init]; NSData *finalData = [newTreeRoot XMLData]; [sendEvent launchFinalCutPro];// I added this one, so don't worry about it. [sendEvent create:kAEImportXMLToDocument // Event: open a project file class:kFCPEventClass // Class: FCP Events dest:kFCPEventClass]; // Destination: FCP Events [sendEvent sendXML:finalData]; // attach the XML Data
// send the event [sendEvent send];
}
On Feb 21, 2010, at 9:24 PM, Helena Ju wrote: Brad,
And change the event popup to 'sendXML' and plug your XML file in there and make sure you get the same result.
Another possibility is that the XML translation file is missing in your FCP 5 installation, but then importing the file should never work in that application, regardless of how you send it along.
Cheers, Helena On Feb 21, 2010, at 2:40 PM, Brad Wright wrote:
Does anyone know why I can import an XML file into FCP 5, but it refuses to import when I send it to Final Cut Pro via the events. I'm generating an XML file from my application and FCP 5 doesn't like it when I send it via an event. If I use the import XML command in FCP 5.0 it's fine. FCP 7 works fine for both, but not FCP 5.0. FCP 5 keeps asking for a translation document even though I'm setting it up as an xmeml 1.0 doc.
|