# Run custom script when Refreshing Banks

**URL:** <https://qa.fmod.com/t/run-custom-script-when-refreshing-banks/22405>\
**Category:** Unity\
**Created:** [December 13, 2024, 3:38pm UTC](https://qa.fmod.com/t/run-custom-script-when-refreshing-banks/22405 "2024-12-13T15:38:47Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![mkoepke](https://avatars.discourse-cdn.com/v4/letter/m/58f4c7/32.png) [@mkoepke](https://qa.fmod.com/u/mkoepke)\
**Post date:** [December 13, 2024, 3:38pm UTC](https://qa.fmod.com/t/run-custom-script-when-refreshing-banks/22405/1 "2024-12-13T15:38:47Z")

</div>

I wrote a little editor script to fetch some data from my FMOD Project in the Editor (it creates a Dictionary containing Events and their Banks). Is there a way to call this automatically when using the “Refresh banks” button? Is there a Callback I can hook into?

---

<div class="post-metadata">

**Author:** ![Leah\_FMOD](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/leah_fmod/32/3685_2.png) [@Leah\_FMOD](https://qa.fmod.com/u/Leah_FMOD)\
**Post date:** [December 19, 2024, 2:41am UTC](https://qa.fmod.com/t/run-custom-script-when-refreshing-banks/22405/2 "2024-12-19T02:41:08Z")

</div>

Hi,

There’s no callback you can hook into, but you can modify the relevant source code:

- The bulk of the code for the Bank Refresher is at “./Assets/Plugins/FMOD/src/Editor/BankRefresher.cs”
- The actual process of reading from the updated banks and generating editor assets is handled by `EventManager.RefreshBanks()` in “./Assets/Plugins/FMOD/src/Editor/EventManager.cs”
- The Bank Fresh window is handled by “./Assets/Plugins/FMOD/src/Editor/BankRefreshWindow.cs”

By the sounds of it, you’ll probably want to insert your code after line 233 of `BankRefreshWindow.cs`, which is where the code handling the clicking of the “Refresh” button in the bank refresh window is located.

---

<div class="post-metadata">

**Author:** ![mkoepke](https://avatars.discourse-cdn.com/v4/letter/m/58f4c7/32.png) [@mkoepke](https://qa.fmod.com/u/mkoepke)\
**Post date:** [December 20, 2024, 1:30pm UTC](https://qa.fmod.com/t/run-custom-script-when-refreshing-banks/22405/3 "2024-12-20T13:30:55Z")

</div>

Thank you, that worked perfectly!
