Tweaking gskinner’s compileProject script


Recently I had the need to rebuild a whole bunch of Flash movies, more than I wanted to do manually. Before writing my own JSFL script to automate the process, I did a quick Google search and found Grant Skinner’s FLA Batch Compiler script. It’s very flexible and very handy: exactly what I needed.

Grant’s script uses a text file to specify what files need to be built and where the resulting SWFs should be copied. However, the text file uses single tab characters (ASCII 9) to separate the fields, and I like to configure my text editors to insert spaces instead of the tab character.

I made a small modification to Grant’s script to allow any amount of whitespace (spaces or tab characters) in between each field in the schema file.

I changed this (around line 49 in compileProject.jsfl):

    var l = schema.length;
    for (var i=0;i<l ;i++) {
        var row = schema[i].split(String.fromCharCode(9));

to

    var l = schema.length;
    var regExpDelimiter = new RegExp("[ \t]+");
    for (var i=0;i<l ;i++) {
        var row = schema[i].split(regExpDelimiter);

And that was that!

(I originally tried using the literal RegExp notation [e.g. scheme[i].split(/[ \t]+/)], but it didn’t seem to want to compile that way.)

Information and Links

Join the fray by commenting, tracking what others have to say, or linking to it from your blog.


Other Posts
Virtual Worlds
Welcome!

Write a Comment

Take a moment to comment and tell us what you think. Some basic HTML is allowed for formatting.

Reader Comments

Be the first to leave a comment!