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

one path back from originalDocPath scripting

New Here ,
Oct 14, 2022 Oct 14, 2022

Copy link to clipboard

Copied

I'm using scripts to save PDFs in various formats in various folders. 

 

var PRINT = Folder(originalDocPath + "/Print");
if (!PRINT.exists) {
    PRINT.create();
}
var _pdfFileName = PRINT.fsName + "/" + originalDocName + "_PRINT.pdf";
var dest = Folder(PRINT);

My Folder structure looks like this.Screenshot 2022-10-14 at 09.01.36.png\

Currently I have to have the document saved in the enclosing folder (5000_ABC_Example) but I want to have it in the Artwork folder. 

Basically how do I direct to:

originalDocPath but back one folder?
TOPICS
Scripting

Views

67

Likes

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

Advisor , Oct 14, 2022 Oct 14, 2022

@Kyle26205577rhrw,

 

I see now...

Give this a try...

 

 

 

var LOWRES = Folder(originalDocPath.parent + "/Low Res");
if (!LOWRES.exists) {
    LOWRES.create();
}
var _pdfFileName = LOWRES.fsName + "/" + originalDocName + "_LR.pdf";
var dest = Folder(LOWRES);

 

 

 

Regards,

Mike

Likes

Translate

Translate
Community Expert ,
Oct 14, 2022 Oct 14, 2022

Copy link to clipboard

Copied

Simple URI notation:

 

\..\Artwork

 

Mylenium

Likes

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
New Here ,
Oct 14, 2022 Oct 14, 2022

Copy link to clipboard

Copied

Hi, thanks for the fix.

var LOWRES = Folder(originalDocPath + "\..\Low Res");
if (!LOWRES.exists) {
    LOWRES.create();
}
var _pdfFileName = LOWRES.fsName + "/" + originalDocName + "_LR.pdf";
var dest = Folder(LOWRES);

creates a new folder - 

Screenshot 2022-10-14 at 09.19.15.png

What am I doing wrong?

 

Likes

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
Advisor ,
Oct 14, 2022 Oct 14, 2022

Copy link to clipboard

Copied

@Kyle26205577rhrw 

 

It's not clear from your screen shot where the new "LOWRES" folder is being created.

 

Regards,

Mike

Likes

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
New Here ,
Oct 14, 2022 Oct 14, 2022

Copy link to clipboard

Copied

Hi @mikeb41294032 

The script is creating a folder named "Artwork..Low Res" inside of "5000_ABC_Example".

I want it to create a folder inside "5000_ABC_Example" called "Low Res" (If it doesn't already exist) and save the new file in it.

Likes

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
Advisor ,
Oct 14, 2022 Oct 14, 2022

Copy link to clipboard

Copied

@Kyle26205577rhrw,

 

I see now...

Give this a try...

 

 

 

var LOWRES = Folder(originalDocPath.parent + "/Low Res");
if (!LOWRES.exists) {
    LOWRES.create();
}
var _pdfFileName = LOWRES.fsName + "/" + originalDocName + "_LR.pdf";
var dest = Folder(LOWRES);

 

 

 

Regards,

Mike

Likes

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
New Here ,
Oct 14, 2022 Oct 14, 2022

Copy link to clipboard

Copied

@mikeb41294032 

That creates a folder outside of the folder 

Screenshot 2022-10-14 at 10.33.58.png

But changing "\Low Res" to "/Low Res" fixed it.

I now have what I wanted 🙂

Screenshot 2022-10-14 at 10.37.47.png

 

Thanks for your help

var LOWRES = Folder(originalDocPath.parent + "/Low Res");
if (!LOWRES.exists) {
    LOWRES.create();
}
var _pdfFileName = LOWRES.fsName + "/" + originalDocName + "_LR.pdf";
var dest = Folder(LOWRES);

 

Likes

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
Advisor ,
Oct 14, 2022 Oct 14, 2022

Copy link to clipboard

Copied

LATEST

@Kyle26205577rhrw,

Yes, I saw that and made edits to my post but you must have copied the code before hand.

 

Regards,

Mike

Likes

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