On Nov 24, 2008, at 4:05 AM, frank wrote:
1 - Is there a way to add media (audio or video) to an FCP project using apple events?
You can add media via the apple events by sending an apple event that has XML that references the media in question.
2 - If so, does anyone know of an example that I might learn from?
The easiest way to see what the XML should look like is to:
1. do what you want the XML to do (import some media)
2. select the relevant objects objects (clips in the FCP browser)
3. Use the menu option File > Export > XML...
4. say 'OK' at the dialog (you don't need to include master clips since your clips are master clips)
5. open up the XMl in a text editing application like BBEdit or TextEdit.
All that being said, you can also make XML that is much simpler than the XML FCP will generate (which contains more information than you may care about).
is a great simple example. If you know the file is online, you can skip putting some of of the information on the <file> (we'll get it from the file at that pathurl) and do something like this:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE xmeml>
<xmeml version="4">
<clip id ="Jeremy Solo">
<name>Jeremy Solo</name>
<duration>188</duration>
<rate>
<ntsc>TRUE</ntsc>
<timebase>30</timebase>
</rate>
<file id="Jeremy Solo1">
</file>
</clip>
</xmeml>
But if you're not sure if the file might go offline or not, it is always best to put the name, duration and rate info so we can make the file object and then you can reconnect the media later.
Best Luck!
Helena