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

How to use Folder.userData properly

Engaged ,
Jul 31, 2023 Jul 31, 2023

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
323
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

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

Translate
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");

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

 

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