With the release of Automatic Duck as a free product there really isn’t a great reason to use this script except as an example of XML parsing and Comp creation from parsed properties. For general FCP to AE workflows I’d recommend downloading Automatic Duck Pro Import AE 5.0. Depending on what happens with FCPX I may write new tools for import from FCPX to AE.

Update 04.17.2007

I’ve posted a small application and tutorial at Final Cut Pro to After Effects Scripting without the hassle for those that find the scripting presented here a little daunting. The following article covers the steps and ideas encapsulated in the application if you’re more interested in the process for learning to script After Effects and Final Cut Pro yourself.

I work a lot in Final Cut Pro and After Effects. They are both really strong programs and more than once I’ve had reason to move projects, art, text, etc. between the two programs.

Until recently, the only option you had to do this kind of interchange was a product called Automatic Duck (which I highly recommend btw) and in previous versions you still had to use Avid’s interchange format and jump through a few hoops to move between the programs.

Now with Final Cut XML and more robust scripting available in After Effects you can finally flow between the two programs with relative ease. In this first installment, I’ll outline a simple workflow for getting clips in a FCP sequence into a AE project. In future posts I’ll go over text elements, filters, generator items etc., but all of these follow the same general development cycle and will just be elaborations on a theme.


Final Cut XML was introduced in Final Cut Pro 4 and has gone through one revision at the time of this article. It’s a pretty robust format, but today we are just going to pick out the items necessary to get our work done. After Effects scripting really started to open up at version 6.5 and it looks like Adobe is committed to opening up more and more of the program to outside developers with each revision. What we’re doing today should work fine with at least Final Cut Pro 4 XML and After Effects 6.5.

Final Cut Pro is exporting XML and After Effects is using Javascript for scripting, and luckily enough smart folks have developed an easy way for XML and Javascript to work together (thank you lazyWeb). The “special sauce” for what we’re doing is called JSON. JSON is an interchange format somewhat like xml, but the cool thing about it is that we can use the eval() command in Javascript and get nicely packaged Javascript objects after wrangling our xml.

So the first order of business is to grab the items of interest in a FCP-XML file and convert it to JSON.

(note) In these examples I’m using PHP for the xml wrangling, but just about any programming language with xml, xpath and xslt support that can output json will work fine. I chose PHP for this demo because of it’s ubiquity and relative straight-forwardness. I’m also using PHP 5 for it’s easier XML handling, so so-much for my ubiguity argument. You language zealots can go elsewhere for entertainment.

Step1: Export an FCP-XML file

We are going to export one sequence with a few clips on a timeline for demonstration purposes. I’ll edit one clip to show inpoint-outpoint translation.

1) I place a few clips in a FCP project window and place them in a sequence.

Final Cut Bin

Final Cut Sequence

2) I use the export->xml file window and save as version 1 xml. (I’m not using any features of version 2 and I want compatiblity, this should still work with version 2)

Export XML

Step2: Convert FCP-XML to JSON

1) I parse the FCP-XML file using the following script

//hard coded FCP xml, use a dialog to drive to a file in production
$fcpXML = simplexml_load_file('fcpToJsonCut.xml');
//xpath match on project info
foreach($fcpXML->xpath('//sequence') as $projectInfo){
//if we don't typecast, we get a simplexml container
	$sequenceArray = 

//xpath match on clipitem, in the interest of simplicity we ignore the audio
foreach($fcpXML->xpath('//video/track/clipitem') as $clipitem){

//if we don't typecast, we get a simplexml container
$itemArray[] = array(
     'clip'=>array('name'=>(string)$clipitem->name , 
	//create an array to hold our FCP info
	$jsonArray = array();
	//push our arrays
	array_push($jsonArray, $sequenceArray);
	array_push($jsonArray, $itemArray);
	//encode in json
	$json = new json;
	$encoded = $json->encode($jsonArray);
	//echo the results, in production we would write to a file
	echo $encoded;

This is really the minimum information necessary to get our clips into AE. We use xpath to match the parts of interest, and in the interest of simplicity we ignore the audio clipitems, we’ll save that for a later exercise. We then add our values into two arrays. A sequence array which is all of our information about the project, and an array of video clipitems with information about the edit. Finally, we encode and output our JSON info.

I’m using the json script available here UPDATE: 02-02-2007 It looks like Jack Sleight is doing some remodeling over at where the script I used was housed, I’m going to go ahead and post the version I used for this demo here, I’d go ahead and use the PEAR package since it’s a more thorough implementation but I’ll leave it here for completeness unless Jack asks me to remove it. There is a nice pear package, and even a c extension, but I’m using this class for portability. If you need a faster, more robust option check out the other two.

I’ve hard coded the xml file and the json output in the example, but you’ll want to write a file input and output for your production code, we’ll cover these in future installments.

One of the interesting things in the php code is the typecast from a simpleXml container to strings, ints and floats. If we don’t do this we end up with a container array and a numerically indexed value. You can keep that if you prefer, but it’s a bit cleaner if we typecast here.

Step 3: Import JSON and create elements in AE

Here is the .jsx script to convert the JSON to an AE project.

//I take the echoed JSON data and hard code the result, in a production environment, 
//you'd use a dialog to read in the value, we'll cover that in another exercise

//JSON info		
var encoded_data = [{"sequence":{"name":"fcpToJson","duration":2092,"rate":30,"height":486,"width":720}}
{"clip":{"name":"No Taste",
//the magic JSON eval
var decoded_data = eval(encoded_data);
//check if there is a project, this is no longer technically necessary in AE7 
//but it doesn't break anything so we leave it in, thanks Jeff
	    var myProject = app.newProject();
	    var myProject = app.project;
 //here is where we iterate through our javascript object to grab important data
	for(x in decoded_data){
	//here is where we grab the sequence data
		var sequenceName = decoded_data[x];
		var sequenceHeight = decoded_data[x].sequence.height;
		var sequenceWidth = decoded_data[x].sequence.width;
		var sequenceRate = decoded_data[x].sequence.rate;
		var sequenceDuration = decoded_data[x].sequence.duration / sequenceRate;
//.9 = D1 comp, I've hard coded a float value rather than
// coerce NTSC-CCIR-601 as a pixelaspectratio element
		var myComp = myProject.items.addComp(sequenceName , 
           sequenceWidth, sequenceHeight, .9, sequenceDuration, sequenceRate);
		var layerCollection = myComp.layers;
	//import footage
	for(y in decoded_data[x]){
		var os = system.osName;
// we need the path sans localhost, etc,
// I'm still working on this part, Final Cut and AE use a a different path structure, 
//Final Cut uses a fully qualified URI, i.e. File://localhost whereas 
//AE's absoluteURI is based off the boot drive, so we work backwards from Volumes. 
//Of course this breaks on the users folder which resolves to ~/,
//this case is not handled here and we don't even check for Windows,
//since your using a Mac for Fcp right? 
//And if you move the project from the drive you created the XML, the hard path breaks. 
//Geez! Lot's of work to do here. Luckily it's just a demo. 
//Feel free to drop me a line if you've worked through this better than I have.
	if(os == 'MacOS'){
		var fileRef = decoded_data[x][y].clip.path;
		if(fileRef.indexOf('Volumes') != -1){
			//on full hd path
			var pathStart = 'Volumes';
var fileSubstring = fileRef.substring(fileRef.indexOf(pathStart) + pathStart.length, fileRef.length);
//AE is a little weird here, you have to build an ImportOptions object so you can import the file. 
	var my_io = new ImportOptions(new File(fileSubstring));
	var myItem = myProject.importFile(my_io);
//We first have to import the footage before we can place it, 
//this is because items is a numerically indexed object rather than named...
//or at least I think so, if you know how to address an item by name 
//this next part might be unnecessary.	

//insert footage
	var items = myProject.items;
	var allFootage = new Array();
//run backwards to keep layer position
	for (var i = items.length; i > 0; i--){
   		if (items[i].typeName == "Footage"){         // Retrieve only footage items
        		allFootage[allFootage.length] = items[i];
    for(x in allFootage){


//finally we position the footage, making arrangements for inpoint/outpoint if there was a cut.
//position footage
    var layerIterator = 1;
		for(x in decoded_data){
			for(place in decoded_data[x]){
					var start =  decoded_data[x][place].clip.start / sequenceRate ;
					var end =  decoded_data[x][place].clip.end / sequenceRate ;
					var duration = decoded_data[x][place].clip.duration;

	//check for a cut
	if((decoded_data[x][place].clip.end - decoded_data[x][place].clip.start) != duration){

		var fcpin = decoded_data[x][place].clip.fcpin;
		var fcpout = decoded_data[x][place].clip.fcpout;
		var cutStart = start - (duration - fcpin) / sequenceRate;
	     myComp.layer(layerIterator).startTime = cutStart;
	     myComp.layer(layerIterator).inPoint = cutStart + fcpin / sequenceRate;
		myComp.layer(layerIterator).outPoint = cutStart + fcpout / sequenceRate;
		myComp.layer(layerIterator).startTime = start;

Place the .jsx script from the sample files in the .zip file below in the Applications/After Effects/scripts folder, and select file:run script. In the next dialog, select the json file you produced in the php step above.

Run Script in After Effects

That’s it in a nutshell. There is not much error catching and the info we extract from the xml is very task specific, but that is the beauty of a workflow hack. We get right to the meat of our problem in a very direct way so that we can concentrate on the task at hand. If you find yourself doing the same sort of thing over and over again, I encourage you to develop more robust routines and plan for where things might go awry (like our path problem above).

AE Project
AE Comp Window


I wouldn’t forego your purchase of Automatic Duck if you’re moving lots of data between the programs on a regular basis. Think of Automatic Duck as the heavyweight solution for workflow when you need to move projects on a regular basis and FCP-XML to AE scripting as the more lightweight and hackable option when you need to munge data or develop your own solutions for a project.

I’ll be going over more examples in the coming weeks. We’ll flesh out our toolkit for moving between the two programs and do some cool hacks. As always, if you have any ideas or corrections to the above give me a shout at dale(at)creative-workflow-hacks(dot)com.

Here are the files used in this demo. I’ve enclosed the sample fcp.xml for demonstration purposes, but remember the path will fail because your drives and media won’t match mine. I encourage you to play with your own files, but be sure to take a look at the limited path support included in the script and adjust accordingly.

tip of the hat to Jeff Almasol at redefinery for the excellent scripting reference stuff.


  1. dr woohoo said

    this is great dale. keep it coming.


  2. Dale said

    Thanks for the kind comment Drew. Really like what your doing at dr woohoo also.



  3. […] Creative Workflow Hacks is the blog for you. I especially enjoyed this post that illustrates how to get under the hood of Final Cut Pro XML files in the most useful way. […]

  4. […] One of the notable short comings of the workflow I outlined for converting Final Cut Pro elements into After Effects projects via scripting was the limited path support. That was mainly due to the fact that Final Cut Pro uses a fully qualified path url of the form file://path/to/file and After Effects has an Absolute URI that uses the tilde as a shortcut for the current user’s home directory. So, file://Volumes/MyHD/Users/Dale/Stuff becomes ~/Stuff. Trying to munge all of the contingencies in Javascript is not a pleasant task, and Cocoa has a nice set of methods for dealing with just this situation, including stringByAbbreviatingWithTildeInPath and stringByExpandingTildeInPath. […]

  5. Kyle said

    Just had a look at this workflow, and it seems to be incredibly useful. However, the Json translation part is a little over my head, and the file at is down. Is there a way to just run the php files on an OSX box using the built in tools?


  6. Dale said

    Hey Kyle,

    I’ve been working on some follow up tools to this article. I’m hoping to get some updated scripts that will make the tech sketch above more useful and user friendly. I’m just in the middle of a really massive project right now and I’m trying to get some time to work on things.


  7. Kyle said

    Oh great!

    Well i’ve just had some limited success using entropy php which allows me to run simplexmlParse in a browser, but the results just echo to the same browser window. I’ve tried copying and pasting the results into a text file and saving it as a .json file manually, but the jsontest.jsx script won’t recognize a file created in that way. If you have any tips on how to get around that one issue, i think i’m set for now…


  8. Dale said

    Hi Kyle,

    the echo in the browser should work, you may need to copy/paste from the source and not the browser window. If your still getting errors, why don’t you post them here or send them via email to dale(at)creative-workflow-hacks(dot)com, it may take me a bit to get to it, but I’ll try and help out.


  9. Kyle said

    Ok, got that part to work. But now when i run the script within after effects, i get the following error:

    “Unable to execute script at line 63. After Effects error: Path is not valid. Path: Applications/Adobe After Effects 7.0/Scripts/tmp00000001”

    is this related to the post at:


  10. Dale said

    Hey Kyle,

    Yes. That’s the problem I’m working on right now. What I’m planning on now, is to check for a valid path using the tool I’m developing and if I can’t create a valid path substituting a footage not found placeholder. If you can get the path that After Effects expects it should work as described above, but I’m working on a more robust path solution.

    Thanks for the feedback.


  11. Peter said


    Thanks for the work and great information. I would love to use your scripting method to move from FCP to AE. However, I’m a designer, editor and artist and, though astute, scripting to me is like Ancient Greek. I have downloaded your files and tried to follow your instructions, but it’s a little like giving an infant a broken-down car and watching it bash, push and chew on the parts, but not really get any closer to driving.

    Is there a GUI version of what you are talking about, or at least a guide for complete scripting morons? I can get through step 1, and step 3 is a breeze, of course, but in the middle I start beating my head and making grunting noises when I read in step 2: “parse the XML…” I start to feel deficient and need to retouch something just to feel smart again.

    At any rate, I would love to hear from you on this. Thanks again!

  12. Dale said

    Hey Peter,

    Thanks for the feedback. This post started as just a tech demo explaining how I was approaching some workflow issues that I had encountered. It has become really popular, but the number one question I get is, “I’m not really technical, how can I make this happen”?

    I’ve posted some follow up posts and done some work to try and help folks out, but the number one thing I can say is that these techniques require some technical knowledge and developing a solution that is easy to use for non-technical folks is probably beyond the scope of these techniques.

    I really am a big fan of Automatic Duck. It is definitely worth the investment if you do any real work with Final Cut Pro and After Effects. They offer super support and constant development with bug fixes.

    And if you get some time on the weekends, play with these techniques and explore scripting. It’s a bunch of fun.



  13. Kyle said

    Hi, sorry to pipe up again. I’ve been playing with this but always just get stuck on the line 63 issue. The funny thing is that AE will fail on running the json script file at line 63 saying the path is invalid in the debugger tool, but yet the file being referenced is actually successfully imported and a composition with the clips name is created.

    I’ve tried manually hard coding the path in the file being read by the javascript, but i’m not sure what it should be,

    Assuming this is where i am keeping my files:

    could you help me figure out how to write that into the text file for the script to understand it properly? everything after “path”:


  14. Hey Kyle,

    Sounds like you’re moving in the right direction. Since the file is being imported and a comp is being made, let’s try this:

    instead of:

    var my_io = new ImportOptions(new File(fileSubstring));
    var myItem = myProject.importFile(my_io);

    use this:

    var my_io = new ImportOptions(new File(fileSubstring));
    var myItem = myProject.importFile(my_io);


    Does this still give you the error in the debugger? What we’re doing here is trying to eat the error if it is actually working.

    As far your path question, I’m not sure what your asking when you say “how to write that into the text file”, would you like to encode the example path as a sample to make sure you can import files?

    Basically the way final cut writes paths is different then what After Effects expects. The line 63 error is an After Effects temp path so I think something is going wrong on your system, I don’t get anything like that when I run the script. If the above doesn’t work, I’d like you to comment out the import and write back with what AE gives you when you run the script with these lines…

    //var my_io = new ImportOptions(new File(fileSubstring));
    //var myItem = myProject.importFile(my_io);

    Let me know what happens.


  15. eugen said

    dear dale !
    i have been trying for the last two days to sort this thing out … im at teh point now where i have my json data and the script in ar but it gives me weird patherrors. i really would need help . thnx in advance

  16. Dale said

    Hi Eugen,

    Could you follow the steps in the comments I gave to Kyle right before your comment? That will help me know the problems you’re having and debug a fix.



  17. eugen said

    hey dale,
    i do get also this line 63 error and + i tried your codesuggestions after .. but i got different errors then .. but i think they always got something to do with paths .. .. sometimes i just get an empty failuremessage. i wonder if u can tell me a way to byapss this filepaths so i would just get the aeprojects with the offline footageclips which i would reconnect myself then .. that would help me alot already… cheers from swizzerland, eugen

  18. Dale said

    eugen and anyone having path problems…

    What we need to do is what a programmer does when he debugs a program. First we need to isolate the problem. Start with a single clip in a sequence and go through the steps. Does that clip give you a path error? If it does. note the path. Does it have the problem outlined here:

    path problems outlined

    If it does, we need to adjust the path because AE and FCP expect different paths. If it doesn’t, keep adding a single clip until we can reproduce the error.

    The error is very important. I can’t help you if you just say, “I get errors”, we need to note the error and figure out what problem AE is having. Copy/Paste the error and try and figure out where the invalid path is coming from.

    So, basically the steps outlined above will help you isolate exactly what the problem is. I know the script can work because I use it all the time and others have reported success, we just need to take things step by step.

  19. eugen said

    hello dale ! .. ya i started with a small seqeunce ..meaning i put my file witt the name “” on the root level of my drive called mediadrive … drag it into sequence of fcp, make 5 edits and drag them around a little …xml1 export it “php_json” it and run it it with json script in afx …my file.json looks like this :

     [{"sequence":{"name":"Sequenz 5","duration":308,"rate":25,"height":1080,"width":1440}},

    unfortunately this time i kept it simple i got another errror :

    it says : unable to execute script at line 104 . After effects error: Unable to call layer because of parameter1. the range has no values.

    btw. must the json file alslo be located somewhere specifically ?
    i wouldnt think so bu maybe ?
    help would be apreciated and i hope im a little more detailed now ,
    cheers ,

  20. eugen said


  21. Dale said

    Hey Eugene,

    no problem. just put your code between <pre></pre> tags and it should work.

    So, this is useful, the second path in the json you pasted is empty, “path”:””
    can you send me the original fcp-xml and the json file you created to dale(at)creative-workflow-hacks(dot)com? That might be the source of your problem.

  22. Dale said


    so eugen sent me the files he was having problems with and I think I see where the path problems might be arising for at least some of the folks posting comments. I’ll need a bit to prepare a fix, but I’ll be sure and post the updated script here and make it obvious there is an update.


  23. eugen said

    sir! id like to say that you are rocking !
    thnx so far … in the meantime ill finish my project like a good old farmer .. plugging seeds by hand .. .

  24. Adam said

    Hey Dale — I get the “error 63” error as well. Can’t wait to see the new script — there’s a million salivating FCP+AE users out there who can’t afford AD, and this solution would be perfect!

  25. […] One of the most popular pieces of content here is Moving Between Final Cut Pro and After Effects: The Scripting Option. I think the idea of using scripting to move between Final Cut Pro and After Effects resonated with people working in a production environment. Unfortunately, the post was more of a tech demo of the kinds of things that were possible with After Effects scripting and less of a practical demonstration for non-technical users. I still urge non-technical folks to dip their toes into the scripting waters, it can be really rewarding, but the challenges presented in “rolling your own” in this situation may be a bit much. […]

  26. Jan said

    Hi Dale. Great site. I’m an editor and really don’t want to learn any coding. I would, however, like to find someone who can parse fcp xml. I’ve logged an 86 reel documentary with many clip markers, as well as standard fields such as master comments, log notes, etc.

    Since FCP searches do not include markers & marker comments, I’d like to get them from the xml, along with all of the normal “edl” type fields.

    These could all be opened in a simple program like Filemaker pro, where I could do a word search that would check EVERY field, thusly locating all that I’m looking for. I can’t believe I just said “thusly”.



  27. Dale said

    Hey Jan,

    That’s a relatively easy task to extract that info from Final Cut XML although I haven’t written any scripts or tools for that.

    You might take a look at:

    There are a lot of freeware and reasonably priced tools there for dealing with FCP-XML. I’m always writing tools and scripts also so I’ll add your request to the list and hopefully come up with something you’d find useful.

    Thanks for the kind words…


  28. Michael said

    Hey Dale,
    Your work on this is awesome. I’ve been needing something like this forever. I have run across a strange bug though. Actually, it’s not really a bug, but I thought I would mention it in case anybody else experienced the same problem.

    It seems that if there are slashes in the name, it errors on import saying “unable to import footage, including placeholder”. I know slashes in a name is a bad thing, but I got a bunch of footage from somebody and they had put a bunch of slashes in all the names. It was a pain to get through. But at least you can just rename in final cut and then select all the files and say rename/file to match clip.

    Anyway, keep up the good work. I don’t understand what you are doing, but I like it.

  29. Dale said

    Hey Michael,

    Thanks for the heads up! I’ll have to take a look at that problem, but it doesn’t suprise me too much. Like you said, slashes are a big deal when it comes to paths, but I should be able to escape them if I make a special check for them.


  30. i have an insane 8 channel art installation due april 9th and i need to transfer a final cut project into AE. all of this scripting is way out of my league. as an end user with no scripting experience is there any program out there that will baby me through it?? is automatic duck the answer to my ineptitude

  31. Dale said

    Hey Bill,

    I’d try in order:

    1).this script

    It works pretty well for cuts only stuff.

    2). this script

    same idea, some folks have had success here when the script I wrote hasn’t worked and vice versa

    3). If you have Premiere access. The workflow from AE->Premiere->FCP can work.

    4). Automatic Duck, seamless, but commercial and costs $$$.

    Best of luck,


  32. Ashley Swanson said

    Hi Dale,
    This is superb info that I’ll most likely visit in the future.
    However, I’m hoping you can help me out or point me in a direction;
    I need to get an aet. file into FCP. In the end I’d like to be able to open this After Effects templet in FCP in a way in which all the animation is preserved but the text field is open to edit in, in FCP. Any suggestions?
    Thanks much.

RSS feed for comments on this post

Comments are closed.