JSFL 批量发布指定目录下的所有.fla,包括子目录下的.fla

//===jave.lin===
var publishFolder = fl.browseForFolderURL("请选择你要批量发布.fla的目录");

var num = 0;
var summaryTxt = "";

batToDo(publishFolder);
alert("批量发布完成\n" + summaryTxt);

function batToDo(folder)
{

	var files = FLfile.listFolder(folder + "/*.fla", "files");
	var i = 0;
	for(; i < files.length; i++)
	{
		pub(folder, files[i]);
	}
	
	var directorys = FLfile.listFolder(folder + "/../", "directories");
	for(i = 0; i < directorys.length; i++)
	{
		batToDo(folder + "/" + directorys[i]);
	}
}

function pub(dir, file)
{
	var doc = fl.openDocument(dir + "/" + file);
	doc.publish();
	doc.close();
	summaryTxt += num++ + "、" + file + "\n"
}


你可能感兴趣的:(JSFL 批量发布指定目录下的所有.fla,包括子目录下的.fla)