# Custom Export Script Get Event Bus

**URL:** <https://qa.fmod.com/t/custom-export-script-get-event-bus/21782>\
**Category:** FMOD Studio\
**Created:** [June 19, 2024, 5:49pm UTC](https://qa.fmod.com/t/custom-export-script-get-event-bus/21782 "2024-06-19T17:49:43Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![OwenMdvd](https://avatars.discourse-cdn.com/v4/letter/o/b5e925/32.png) [@OwenMdvd](https://qa.fmod.com/u/OwenMdvd)\
**Post date:** [June 19, 2024, 5:49pm UTC](https://qa.fmod.com/t/custom-export-script-get-event-bus/21782/1 "2024-06-19T17:49:43Z")

</div>

Hi,  
I created a custom FMOD Script to export for Unity a class with a dictionnary, with the event path and the InGame Bus (its an enum)

But i cannot get the current event bus

```auto
textFile.writeText(" public class BusByEvent" + "\r\n {\r\n");

  var whitespace = "";
  var identifierPrefix = "";
  var guidType = "";
  var guidConstructor = "";

  whitespace = " ";
  guidType =
    "public static readonly Dictionary<string,SoundBus> Data = new Dictionary<string, SoundBus>(){\n";
  guidConstructor = "{";

  textFile.writeText(whitespace + guidType);

  managedObjects.forEach(function (object) {

    var bus = "SoundBus.InGame";

    //HERE GET THE EVENT BUS

    textFile.writeText(
      whitespace +
        " " +
        guidConstructor +
        '"' +
        object.getPath() +
        '"' +
        "," +
        bus +
        "},\r\n"
    );
  });

  textFile.writeText(" };\r\n\r\n");

  textFile.writeText(" }\r\n\r\n");

```

I only need the comment line

Thank you for ur help 😃

---

<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:** [June 24, 2024, 2:58am UTC](https://qa.fmod.com/t/custom-export-script-get-event-bus/21782/2 "2024-06-24T02:58:54Z")

</div>

I may have misunderstood what you’re trying to do, but assuming that each element of `manageObjects` is a given event, you can retrieve the mixer bus an event is routed into with `object.mixerInput.output`.

If this isn’t what you’re trying to do, can I get some more info from you on what exactly you’re trying to do, and what `managedObjects` contains and how you’ve retrieved/populated it?

---

<div class="post-metadata">

**Author:** ![OwenMdvd](https://avatars.discourse-cdn.com/v4/letter/o/b5e925/32.png) [@OwenMdvd](https://qa.fmod.com/u/OwenMdvd)\
**Post date:** [June 24, 2024, 11:30am UTC](https://qa.fmod.com/t/custom-export-script-get-event-bus/21782/3 "2024-06-24T11:30:47Z")

</div>

Oh Thank you, was exactly what i needed. Yes the `manageObjects` was an event, i just reused the ExportGUID based script but didnt rename my variable.  
Again TY 😃
