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

check if the folder exists

Participant ,
Nov 01, 2018 Nov 01, 2018

I would like to create a script

that selects a folder with the name test

the folder is on the desktop

so I get to the point

if the test folder exists, the warning goes out ok

if the folder does not exist, a warning ko is issued

thank you

TOPICS
Actions and scripting
1.8K
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

Contributor , Nov 01, 2018 Nov 01, 2018

Is this the sort of thing you're after?

   var dt =  "~/Desktop/"

   

    var aFolder= Folder (dt + "/test/")

    if (!aFolder.exists) { alert("no folder")

    } else { alert ("folder exists") }

Translate
Adobe
Contributor ,
Nov 01, 2018 Nov 01, 2018

Is this the sort of thing you're after?

   var dt =  "~/Desktop/"

   

    var aFolder= Folder (dt + "/test/")

    if (!aFolder.exists) { alert("no folder")

    } else { alert ("folder exists") }

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 ,
Nov 01, 2018 Nov 01, 2018

works well

a question

if the test folder is in the same folder as the script

how could it be done?

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
Contributor ,
Nov 01, 2018 Nov 01, 2018

Not sure with the script location, but you can for the active document.

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 ,
Nov 01, 2018 Nov 01, 2018
LATEST

I do not know if you can use it

Folder.path

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