FORUMS: list search recent posts

Batch Export PNG Sequence

COW Forums : Adobe Flash

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Steve Ashley
Batch Export PNG Sequence
on Oct 18, 2012 at 6:22:48 pm

I have this script I found online, is there a way to change it to export a png file sequence instead of publishing?




var tempDoc=undefined;
if(fl.documents.length==0){
//xmlPanel need a document, if there is none, create a temp document
tempDoc=fl.createDocument();
}
xui = fl.getDocumentDOM().xmlPanel(fl.configURI + "Commands/AutoPublishUI.xml");
if(tempDoc){
//close temp document
fl.closeDocument(tempDoc);
}
if(xui.dismiss=="accept"){
var searchSubDir=xui.searchSubDir;
var onlyUnpublished=xui.onlyUnpublished;
var folders=xui.paths.split("r").join("").split("n").join("");
var writeFile=xui.writeToFile;
fl.trace(writeFile);
folders=folders.split(",");
//fl.trace(folders);
for(var i=0;i<folders.length;i++){
if(folders[i].substr(0,8)!="file:///"){
folders[i]="file:///"+folders[i].split(":").join("|").split("").join("/");
//fl.trace("format:"+folders[i]);
}
if(folders[i].substr(folders[i].length-1,1)!="/"){
folders[i]=folders[i]+"/";
}
}
exportlist=new Array();
//fl.trace(folders);
for(var j=0;j<folders.length;j++){
checkFolder(folders[j],exportlist,searchSubDir,onlyUnpublished);
}
var totaltime=0;
if(exportlist.length==0){
alert("No file need to publish.");
}else{
//fl.trace(exportlist.join("n"));
fl.trace(writeFile);
if(writeFile=="true"){
var d=new Date();
var script="//publish script created at "+d+"n";
script+="function formatTime(num){n";
script+=" var h=Math.floor(num/3600000);n";
script+=" num=num%3600000;n";
script+=" var m=Math.floor(num/60000);n";
script+=" if(m<10){n";
script+=" m="0"+m;n";
script+=" }n";
script+=" num=num%60000;n";
script+=" var s=Math.floor(num/1000);n";
script+=" if(s<10){n";
script+=" s="0"+s;n";
script+=" }n";
script+=" num=num%1000;n";
script+=" return h+":"+m+":"+s+"."+num;n";
script+="}n";
script+="function exportswf(id,total,flapath,swfpath){n";
script+=" fl.trace("["+id+"/"+total+"] "+flapath.substr(flapath.lastIndexOf("/")+1)+"t@ "+flapath.substr(0,flapath.lastIndexOf("/")));n";
script+=" var stime=new Date().getTime();n";
script+=" var fla=fl.openDocument(flapath,true);n";
script+=" if(swfpath==undefined){n";
script+=" swfpath=flapath.substr(0,flapath.lastIndexOf("."))+".swf";n";
script+=" }n";
script+=" fla.exportSWF(swfpath,true);n";
script+=" fla.close(false);n";
script+=" var etime=new Date().getTime();n";
script+=" fl.trace("Completed in "+formatTime(etime-stime));n";
script+=" return etime-stime;n";
script+="}n";
script+="var totaltime=0;n";
script+="fl.trace("Start publishing...");n";
for(var i=0;i0){
// return m+":"+s+"."+num;
//}else{
// return s+"."+num+"s";
//}
}
function exportswf(flapath,swfpath){
//return 0;
var stime=new Date().getTime();
var fla=fl.openDocument(flapath,true);
if(swfpath==undefined){
swfpath=flapath.substr(0,flapath.lastIndexOf("."))+".swf";
}
fla.exportSWF(swfpath,true);
fla.close(false);
var etime=new Date().getTime();
return etime-stime;
}
function checkFolder(folder,list,checkSub,checkSwf,pre){
if(pre==undefined){
pre="";
}
//fl.trace(pre+folder+":"+checkSub+" "+checkSwf);
var flas=FLfile.listFolder(folder+"*.fla","files");
for(var i=0;i<flas.length;i++){
//fl.trace(pre+" "+flas[i]);
if(checkSwf=="true"){
var flatime=Number("0x"+FLfile.getModificationDate(folder+flas[i]));
var swfname=flas[i].substr(0,flas[i].lastIndexOf("."))+".swf";
var swftime=Number("0x"+FLfile.getModificationDate(folder+swfname));
//fl.trace(swfname+" "+flatime+" vs "+swftime);
if(swftime<(flatime-100)){
list.push(folder+flas[i]);
fl.trace(pre+flas[i]);
}
}else{
list.push(folder+flas[i]);
fl.trace(pre+flas[i]);
}
}
if(checkSub=="true"){
var flds=FLfile.listFolder(folder,"directories");
for(var i=0;i<flds.length;i++){
//fl.trace(pre+i+" "+flds[i]+" of "+flds.length);
checkFolder(folder+flds[i]+"/",list,checkSub,checkSwf,pre+" ");
//fl.trace(pre+i);
}
}
}


Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2018 CreativeCOW.net All Rights Reserved
[TOP]