Skip to main content
bagonterman
Inspiring
Aug 5, 2013 11:52 AM UTC
Question

.type on PC side is showing ???? for all of .type

var poot=Folder("/eDesignArchive/eExtract/"+myJnum+mySFolder);

poot=Folder(poot.fsName);

var boot=poot.getFiles();

myMatches=[];

myArchive=[];

    for (var j = 0; j < boot.length; j++) {

       if(boot.type!="????"){ myArchive.push(boot.name);}

        for ( i = 0; i < count; i++ ) {

            pageImage =doc.visibleThumbnails.name;

          if((pageImage.match ( boot.name))){  myMatches.push(boot.name);}

     }

};

I am using this on the mac side and it returns all the different file types. I am trying to exclude  a database file. On the mac I get different file types like 8bps or JPEG or TIFF. All the files are turning up ???? on pc. Not sure why. Any ideas? At first I thought my array was empty but I know now that its ok.

This topic is closed to new replies. Start a new post to keep the conversation going.

5 replies

Inspiring
Aug 5, 2013 2:34 PM UTC

Windows doesn't use the type property. The file type is determined by the file extension. One reason a file without an extension is almost useless on Windows. So I think you need to check both type and extension matches to exclude.

Translate
bagonterman
Inspiring
Aug 5, 2013 2:43 PM UTC

I ended up checking the file extention on the pc side. That was the only way I could get it to work. Thanks for your help.

Translate
Inspiring
Aug 5, 2013 2:51 PM UTC

On the Mac side an open getFiles() will return the OS hidden files too… You can exclude these with regular expression they start with a dot. Or you could loop looking for the hidden property…

#target bridge

var inFolder = Folder( Folder.desktop + '/Testing' );

var fileList = inFolder.getFiles();

alert( fileList.join( '\r' ) )

for ( var i = 0; i < fileList.length; i++ ) {

   

    alert( fileList.hidden );

   

};

Translate
Inspiring
Aug 5, 2013 2:32 PM UTC

If you read the Scripting Guide you will see that this is a feature of the Mac OS and correctly returns ???? on windows…

Translate