Creating folders using scripts?

Hey, everybody!

I just wonder, can I create folders for assets or events using scripts?

1 Like

Creating a folder:

var folder = studio.project.create('EventFolder');
folder.name = "Hello World";

Assigning a folder to an event:

event.folder = folder;

For assets you can set the path of a ManagedObject:AudioFile by calling AudioFile.setAssetPath, it will automatically create folders based on the path:

AudioFile.setAssetPath(“folder/subfolder/test.wav”);

2 Likes

Thanks! It works :slight_smile:

I have one more question. How to change a path for the folder and event in the project using script?

I figured out. Thanks :slight_smile:

var folder = studio.project.create('EventFolder');
var subfolder = studio.project.create('EventFolder');

folder.name = "Folder";
subfolder.name = "Sub Folder";

subfolder.folder = folder;
1 Like