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

Using Script to Create sub-folder using variable as name - need help

Participant ,
Jul 06, 2023 Jul 06, 2023

Copy link to clipboard

Copied

I have an image in folder in download\TEST, I want create a new sub-folder in test and save image to it

var myDocument = activeDocument;
var f = new Folder(myDocument.path+theResult.join("X"))

if (!f.exists) {

    f.create();

theResult.join("X") is a variable stored values from another function whitch is 2X3, above code created folder

download\TEST2X3 instead download\TEST\2x3 (result I want)

 

How to fix it ? thank you

 

 

 

TOPICS
Actions and scripting , Windows

Views

246

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
Adobe
Community Expert ,
Jul 06, 2023 Jul 06, 2023

Copy link to clipboard

Copied

@Calvin21914323wi10 I'm gonna put money down that @Stephen_A_Marsh is the guy to help you with this one!

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
Community Expert ,
Jul 06, 2023 Jul 06, 2023

Copy link to clipboard

Copied

@Sef McCullough â€“ thanks, no pressure! 

 

There are many scripters here who I believe can also 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
Community Expert ,
Jul 06, 2023 Jul 06, 2023

Copy link to clipboard

Copied

@Calvin21914323wi10 â€“ Untested, but perhaps:

 

var f = new Folder(myDocument.path+"/"+theResult.join("X"));

 

Or:

 

var f = new Folder(myDocument.path+"\\"+theResult.join("X"));

 

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 ,
Jul 08, 2023 Jul 08, 2023

Copy link to clipboard

Copied

Second one, works, thank ou very much

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
Community Expert ,
Jul 08, 2023 Jul 08, 2023

Copy link to clipboard

Copied

LATEST

@Calvin21914323wi10 - Thanks for the feedback, please mark my previous reply as the correct answer. I would have thought that both versions would have resulted in a valid directory separator being added.

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