help - file list

I have put together this code after looking at the documentation and a file list script example.

could omeone point out where I am going wrong ?

// DAZ Studio version 4.8.0.9 filetype DAZ Script

var oDir = new DzDir("C:\Users\Mark\Documents\DAZ 3D\Studio\DazScenes");
var aFileNames = oDir.getFilesFromDir( ["*.duf"] ); << I have tried oDir.entryList("*.duf",DzDir.Files)<br /> print (aFileNames.length);
var aFiles = new Array( aFileNames.length );
for( var i = 0; i < aFileNames.length; i += 1 ){
aFiles[ i ] = new DzFile( oDir.absFilePath( aFileNames[ i ] ) );
}


I am simply trying to get an array of the file names as a start to a render script.
I am not finding this script language very easy to understand.

I dont get an error, I just dont get any files listed. print (aFileNames.length); gives me 0

Post edited by marks542004_9dd99e328f on

Comments

  • Richard HaseltineRichard Haseltine Posts: 100,941
    edited December 1969

    You are mis-forming your path - use /, not \, as the folder separator. \ in general cannot be used straight in strings as it is the escape character, used for things like tabs (\t) and returns (\n) - if you do want one, you have to escape it (\\).

Sign In or Register to comment.