Jump to content

displaying File sequence with javascript FSO


Recommended Posts

hi im writing an app with javascript fso to display a file sequence in a list but im having a problem with the display it displays the whole sequence or the second file insted the first file of the sequence .here is the code:

function loadRenderFolders(){var FSO = new ActiveXObject("Scripting.FileSystemObject");var Stable = "";var Etable = "";var Str = "";var Etr = "";var s="";var abc = new Array();var i=0; var f = FSO.GetFolder("Render\\images\\Sh02\\v_03\\");var enumtor = new Enumerator(f.Files);  Stable = "<table cellpadding=0 cellspacing=0 border=0>";   for (; !enumtor.atEnd(); enumtor.moveNext())  {  var name = enumtor.item().Name;  abc[i]=name; i++;  s += "<tr><td nowrap style=\"width:320; height:40; font-size:20; font-family:Calibri; color:#FFFFFF;\" onMouseOver=\"this.style.background='#1f1c29';\" onMouseOut=\"this.style.background='';\"> "+abc[0]+"</td></tr>";  }Etable = "</table>";renderList.innerHTML=Stable+s+Etable;}

Link to post
Share on other sites

Well, from the looks of it you are always hardcoding your output to abc[0], so that's going to be a problem. I'm not sure why you are using an array to prestore the value before you use it, when you get name right from your enumerator class. I can only infer the functionality of these classes since I've never used/heard of them, but perhaps this would work

function loadRenderFolders(){  var FSO = new ActiveXObject("Scripting.FileSystemObject");  var f = FSO.GetFolder("Render\\images\\Sh02\\v_03\\");  var enumtor = new Enumerator(f.Files);  var Stable = "<table cellpadding=0 cellspacing=0 border=0>";;  var Etable = "</table>";  var Btable = "";   for (; !enumtor.atEnd(); enumtor.moveNext()){	var name = enumtor.item().Name;	Btable += "<tr><td nowrap style=\"width:320; height:40; font-size:20; font-family:Calibri; color:#FFFFFF;\" onMouseOver=\"this.style.background='#1f1c29';\"	  	onMouseOut=\"this.style.background='';\"> "+ name +"</td></tr>";  };  renderList.innerHTML = Stable + Btable + Etable;}

Edited by thescientist
Link to post
Share on other sites

thanks for the replay :) but i meant that i need to display the first file name of the sequences for example lets say that i have a files sequence called:

color.001.sgicolor.002.sgicolor.003.sgi shadow.001.sgishadow.002.sgishadow.003.sgi

thats what the script is doing right now it displays all the sequences but what i need is to display only the first file of each sequence for exemple:

color.001.sgishadow.001.sgi

thanks for the help :)

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...