NewYears1978 Posted January 21, 2016 Posted January 21, 2016 Been trying to sort this out but can't find an answer. Since HS is coded in Flash/Autoit I figured I would post here and maybe someone would know I use this script Code: /** PNG2SWF_MULTIPLE JSFL v 1.0* by Matus Laco,* Modified by dark13 to embedd PNGs as uncompressed files and allow smoothing* product URL:* inspired by Mr.doob** Description:* Converts multiple png files to multiple swf files.* Input: Select folder dialog box* Output: Same folder, same filename, swf extension*/png2swf();function png2swf(){ var folderURI = fl.browseForFolderURL("Select a folder."); if (folderURI == null) { return; } var folderContents = FLfile.listFolder(folderURI);var doc = fl.createDocument();doc.backgroundColor = '#00FF00';var imported = 0; for(var i=0; i< folderContents.length; i++){ var pngURI = folderURI + "/" +folderContents[i]; if (pngURI.substr(pngURI.length-4) != ".png") continue; doc.importFile(pngURI); // get item var bmp_lib = doc.library.items[imported]; bmp_lib.compressionType = "lossless"; bmp_lib.allowSmoothing = true; var bmp_tl = fl.getDocumentDOM().getTimeline().layers[0].frames[0].elements[0];// Scale from 1080p to 1024*768 and apply 16:9 ratio correctionbmp_tl.scaleX = 0.53333 ;bmp_tl.scaleY = 0.7111 ;bmp_tl.x = 0 ; bmp_tl.y = 0 ;// set doc size doc.width = Math.floor(bmp_tl.width)+1; doc.height = Math.floor(bmp_tl.height)+1; // export var swfURI = pngURI.substr(0,pngURI.lastIndexOf(".")+1)+"swf"; doc.exportSWF(swfURI, true ); // remove previous from timeline doc.selectAll(); doc.deleteSelection(); // increase imported count imported++; } doc.close(false); alert(imported + " files created.");} Works great except I would like it to also look in the subfolders of my selected folder.Thanks in advance! I've been googling for 2 days, but no luck. Are you an HTPC user? Do you like Kodi/XBMC?If so, check out these Kodi Style Themes!-----------------------------------------------------------------------------------------------------Aeon Nox 13 by @dark13Aeon MQ6 by @NewYears1978 >> Click here to see Current Progress-----------------------------------------------------------------------------------------------------If you're new and going for your first install, I HIGHLY recommend Simply Austin's Tutorials.
NewYears1978 Posted January 21, 2016 Author Posted January 21, 2016 Yes correct Right now it only converts the the files in the main folder Are you an HTPC user? Do you like Kodi/XBMC?If so, check out these Kodi Style Themes!-----------------------------------------------------------------------------------------------------Aeon Nox 13 by @dark13Aeon MQ6 by @NewYears1978 >> Click here to see Current Progress-----------------------------------------------------------------------------------------------------If you're new and going for your first install, I HIGHLY recommend Simply Austin's Tutorials.
Recommended Posts
Archived
This topic is now archived and is closed to further replies.