# What should I do to add a plugin through a script and modify the properties on the plugin?

**URL:** <https://qa.fmod.com/t/what-should-i-do-to-add-a-plugin-through-a-script-and-modify-the-properties-on-the-plugin/20791>\
**Category:** FMOD Studio\
**Created:** [October 21, 2023, 2:28am UTC](https://qa.fmod.com/t/what-should-i-do-to-add-a-plugin-through-a-script-and-modify-the-properties-on-the-plugin/20791 "2023-10-21T02:28:23Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![lxy1114](https://avatars.discourse-cdn.com/v4/letter/l/dbc845/32.png) [@lxy1114](https://qa.fmod.com/u/lxy1114)\
**Post date:** [October 21, 2023, 2:28am UTC](https://qa.fmod.com/t/what-should-i-do-to-add-a-plugin-through-a-script-and-modify-the-properties-on-the-plugin/20791/1 "2023-10-21T02:28:23Z")

</div>

I am currently researching how to add plugins through scripts, and I have found the following plugins available through studio.project.findAvailablePlugins:  
Resolution Audio Listener  
Resolution Audio Soundfield  
Resolution Audio Source  
McDSP ML1 Limited  
AudioGaming AudioMotors  
AudioGaming AudioRain  
AudioGaming AudioWeather  
AudioGaming AudioWind  
But I made an error by adding it in the following way, did I understand it wrong  
Var event=studio.window.browserCurrent();  
Var plugin=studio.project.workspace.createPlugin (“Resolution Audio Source”);  
Var ef=event.masterTrack.mixerGroup.effectChain.addEffect (plugin);  
What should I do to add a plugin through a script and modify the properties on the plugin? Thank you.

---

<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:** [October 26, 2023, 1:14am UTC](https://qa.fmod.com/t/what-should-i-do-to-add-a-plugin-through-a-script-and-modify-the-properties-on-the-plugin/20791/2 "2023-10-26T01:14:45Z")

</div>

Hi,

There seem to be two issue with the code you’ve provided - the plugin is “Resonance Audio Source” and not “Resolution Audio Source”, and PluginEffects cannot be added to effect chains with `addEffect()`, only preset effects can be. The latter of these seems like a bug, so I’ve passed it along to the development team for further investigation.

That said, you can work around this by setting the owner of the plugin to be the effect Chain:

```js
var event = studio.window.browserCurrent();
var pluginEffect = studio.project.workspace.createPlugin("Resonance Audio Source");
pluginEffect.owner = event.masterTrack.mixerGroup.effectChain;

```

Plugin properties are stored in the `pluginParameters` array belonging to the child `plugin` object. For example, the first parameter of a Resonance Audio Source plugin effect, Gain, can be accessed and set as follows:

```js
console.log(pluginEffect.plugin.pluginParameters[0].name); // "Gain"
pluginEffect.plugin.pluginParameters[0].value = -30;

```
