# Get & Rename Folders Using Scripting API

**URL:** https://qa.fmod.com/t/get-rename-folders-using-scripting-api/19843
**Category:** FMOD Studio
**Tags:** javascript
**Created:** [February 7, 2023, 12:43am UTC](https://qa.fmod.com/t/get-rename-folders-using-scripting-api/19843 "2023-02-07T00:43:54Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![ianberman](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/ianberman/32/2319_2.png) [@ianberman](https://qa.fmod.com/u/ianberman)
#### Post date: [February 7, 2023, 12:43am UTC](https://qa.fmod.com/t/get-rename-folders-using-scripting-api/19843/1 "2023-02-07T00:43:54Z")

</div>

Hi! I’d like to rename every folder in my project using the scripting API to standardize naming conventions. I’ve figured out how to do this with events using `studio.project.model.Event.findInstances();` - however, the same idea does not work for folders, eg. `studio.project.model.Folder.findInstances();`

How should I format this query? What concept am I missing?

Thanks!

---

<div class="post-metadata">

### Author: ![Connor\_FMOD](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/connor_fmod/32/3685_2.png) [@Connor\_FMOD](https://qa.fmod.com/u/Connor_FMOD)
#### Post date: [February 7, 2023, 10:29pm UTC](https://qa.fmod.com/t/get-rename-folders-using-scripting-api/19843/2 "2023-02-07T22:29:17Z")

</div>

Hi,

On most objects in Studio, you can use the function `.dump()` which will print their variables and functions in the console. But the main thing to look at for a folder is the `entity` type, while having a folder selected in Studio:

```auto
studio.window.browserCurrent().dump()
(ManagedObject:EventFolder):
id: "{db8b822f-18fa-4a3e-9e18-b425fd8ae064}",
entity: "EventFolder",
isValid: true,
relationships: (ManagedRelationshipMap:EventFolder),
properties: (ManagedPropertyMap:EventFolder),
isOfType: <function>,
isOfExactType: <function>,
note: undefined,
color: "Default",
name: "1",
folder: (ManagedObject:MasterEventFolder),
items: [],
getItem: <function>,
dump: <function>,
document: <function>,

```

Here you can see that folders are actually `EventFolders`. So in your function, you will want to change it to

```auto
studio.project.model.EventFolder.findInstances();

```

The `Folder` entity actually refers to folders in the `Asset` tab as they are folders that exist in the asset directory rather than just in FMOD Studio.

Hope this helps!

---

<div class="post-metadata">

### Author: ![ianberman](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/ianberman/32/2319_2.png) [@ianberman](https://qa.fmod.com/u/ianberman)
#### Post date: [February 8, 2023, 4:44pm UTC](https://qa.fmod.com/t/get-rename-folders-using-scripting-api/19843/3 "2023-02-08T16:44:12Z")

</div>

Thanks Connor, this was really helpful.
