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

How to use Folder.userData properly

Engaged ,
Jul 31, 2023 Jul 31, 2023

Copy link to clipboard

Copied

Hi all,

 

I'm trying to understand how to properly write a few lines of code involving Folder.userData.

When I declare a folder path which of the following is correct?

 

 

 

var myFolderPath = Folder.userData + encordeURI("/MyFolder");
var myFolderPath = Folder.userData.absoluteURI + encordeURI("/MyFolder");
var myFolderPath = Folder.userData.relativeURI + encodeURI("/MyFolder");

 

 

 

They all seem to work. Which is the best choice though?

 

Then, I'll continue with the following:

 

 

 

var myFolder = new Folder(myFolderPath);

 

 

 

 

TOPICS
How to , Scripting

Views

165

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

Community Expert , Aug 01, 2023 Aug 01, 2023

Since it's a Folder object, I think I'd do it this way:

var myFolderPath = Folder.userData.path + "/" + Folder.userData.name + encodeURI("/myFolder");

Votes

Translate

Translate
Community Expert ,
Aug 01, 2023 Aug 01, 2023

Copy link to clipboard

Copied

Since it's a Folder object, I think I'd do it this way:

var myFolderPath = Folder.userData.path + "/" + Folder.userData.name + encodeURI("/myFolder");

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
Engaged ,
Aug 01, 2023 Aug 01, 2023

Copy link to clipboard

Copied

LATEST

Hi Dan, thank you for answering!

 

It looks like any of the following return the same string:

Folder.userData.path + "/" + Folder.userData.name
Folder.userData.absoluteURI

 

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