Skip to main content
yon1313
Known Participant
December 26, 2016
Answered

check if it is folder

  • December 26, 2016
  • 1 reply
  • 519 views

Hi guys ,

I tried to check if file with path is Folder item,

its return me true also if it is not folder item,

what I did wrong?

(I am working on PC)

var MyFolder=new Folder("~/Desktop/test.png");   

if(MyFolder.exists){//Return "True" only if it is folder.

     alert("true");

     }else{

         alert("false");

         }

This topic has been closed for replies.
Correct answer Alex White

var MyFolder = File("~/Desktop/test.png");  

if(MyFolder instanceof File){     // check here

     alert("true");

}else{

    alert("false");

}

1 reply

Alex White
Alex WhiteCorrect answer
Legend
December 27, 2016

var MyFolder = File("~/Desktop/test.png");  

if(MyFolder instanceof File){     // check here

     alert("true");

}else{

    alert("false");

}

yon1313
yon1313Author
Known Participant
December 27, 2016

Tnx a lot