Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Scripting to import and organize files

  • Scripting to import and organize files

    Posted by Multimediagreg on December 5, 2006 at 10:29 pm

    I’ve been reasearching both AE scripting and javascript because I’ve been looking to write a script to automate some repetitive animations. Ideally, I’m looking to access information organized in an XML file to autocreate some comps, but it seems like AE scripting doesn’t understand XML file loading.

    Is there another way to do this? Or any way of accessing information from maybe a tab-delimited text file or database of some sort?

    Multimediagreg replied 19 years, 5 months ago 3 Members · 4 Replies
  • 4 Replies
  • Colin Braley

    December 6, 2006 at 5:24 am

    Give me some more specific info on what you are trying to do and I might be able to help you out. If you are doing very, very basic XML parsing you can do this with AE Scripting by just writing some javascript. However, if you need to do in depth parsing you will need your AE script to call an external application or program (created by you) in a language like C++ or Java, have this app do the parsing using some kind of built in XML parsing library, and then send this information back to your AE script. The former solution would be a lot of work, but it is definetly feasable if you have some programming experience.
    ~Colin

  • Multimediagreg

    December 6, 2006 at 2:59 pm

    I’m looking to be able to access data from an XML file that would contain file names, text strings, and other layer properties, so that I can set up compositions and automate loading in and arranging elements of compositions. For instance, compositions that would have similar layouts and animations, but graphic elements and descriptive text would be swapped out and change from comp to comp.

    This should be very basic XML parsing and on the level of things I’ve done using XML with Lingo in Director. As I’m new to Javascripting and AE scripting (though experienced with C++ and Lingo), my research with books like the O’Reilly Javascript guide and things I’ve found online only talk about XML in Javascript in relation to web browsers. So the sample code includes checks and options for either loading an XML document using Internet Explorer or Firefox. Obviously, I want neither of these options… unless my only recourse is to get my AE script to run another script from a broswer and then return data to AE… but it seems like it should be easier than that.

    So when running “found code” such as “document.implementation.createDocument” AE and the ExtendScript Toolkit return errors that “document” is undefined, though that should be a standard Javascript term, no?

  • Dan Ebberts

    December 6, 2006 at 11:19 pm

    The web/document stuff in JavaScript isn’t implemented in AE scripting. I think your best bet is to defined a delimited flat file structure and write a simple parser for that. It’s not too tough – I do it all the time.

    Dan

  • Multimediagreg

    December 7, 2006 at 10:48 pm

    Thanks Dan,
    Today I was able to get AE to read text from a tab-delimited file… so now I’ll just need to work on actually parsing that data. Much appreciated!

    Greg

We use anonymous cookies to give you the best experience we can.
Our Privacy policy | GDPR Policy