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

check if it is folder

Participant ,
Dec 26, 2016 Dec 26, 2016

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

         }

TOPICS
Scripting
556
Translate
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

correct answers 1 Correct answer

Enthusiast , Dec 27, 2016 Dec 27, 2016

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

if(MyFolder instanceof File){     // check here

     alert("true");

}else{

    alert("false");

}

Translate
Enthusiast ,
Dec 27, 2016 Dec 27, 2016

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

if(MyFolder instanceof File){     // check here

     alert("true");

}else{

    alert("false");

}

Translate
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
Participant ,
Dec 27, 2016 Dec 27, 2016
LATEST

Tnx a lot

Translate
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