Posts Tagged ‘jsfl’

JSFL: Batch Publish Flash Files

This is a script I wrote to batch publish an entire folder of .fla files. The script we use is far longer, as our version is for our courseware folders. In ours, we parse the filename of each to a CSV file with the chapter, section, sub-section, and duration of each .swf.

JSFL rocks.

// pop up a dialog to get the folder, then fetch the files therein
var folder = fl.browseForFolderURL("Choose a folder to publish:");
var files = FLfile.listFolder(folder + "/*.fla", "files");

for (file in files) {
var curFile = files[file];

// open document, publish, and close
fl.openDocument(folder + "/" + curFile);
fl.getDocumentDOM().publish();
fl.closeDocument(fl.getDocumentDOM());
}

Comments