• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

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

Engaged ,
Aug 05, 2013 Aug 05, 2013

Copy link to clipboard

Copied

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.

TOPICS
Scripting

Views

990

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guru ,
Aug 05, 2013 Aug 05, 2013

Copy link to clipboard

Copied

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guru ,
Aug 05, 2013 Aug 05, 2013

Copy link to clipboard

Copied

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Aug 05, 2013 Aug 05, 2013

Copy link to clipboard

Copied

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guru ,
Aug 05, 2013 Aug 05, 2013

Copy link to clipboard

Copied

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 );

   

};

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Aug 05, 2013 Aug 05, 2013

Copy link to clipboard

Copied

LATEST

I just looked at the file name and checked for any .db files because that is the only hidden file i am running into. I am counting the rest.

poot=Folder(poot.fsName);

var boot=poot.getFiles();

myMatches=[];

myArchive=[];

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

        pcName=boot.name.split(".").pop();

       if(pcName!="db"){ myArchive.push(boot.name);}

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

            pageImage =doc.visibleThumbnails.name;

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

     }

};

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines