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

check if the folder exists

Participant ,
Nov 01, 2018 Nov 01, 2018

Copy link to clipboard

Copied

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

Views

1.4K

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

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

Votes

Translate

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

Copy link to clipboard

Copied

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

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

Copy link to clipboard

Copied

works well

a question

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

how could it be done?

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

Copy link to clipboard

Copied

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

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

Copy link to clipboard

Copied

LATEST

I do not know if you can use it

Folder.path

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