# Script For Setting Platform Exclusion on All Instances of an Effect

**URL:** <https://qa.fmod.com/t/script-for-setting-platform-exclusion-on-all-instances-of-an-effect/20945>\
**Category:** FMOD Studio\
**Tags:** javascript\
**Created:** [December 4, 2023, 5:14am UTC](https://qa.fmod.com/t/script-for-setting-platform-exclusion-on-all-instances-of-an-effect/20945 "2023-12-04T05:14:32Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![JSMallard](https://avatars.discourse-cdn.com/v4/letter/j/fbc32d/32.png) [@JSMallard](https://qa.fmod.com/u/JSMallard)\
**Post date:** [December 5, 2023, 5:14pm UTC](https://qa.fmod.com/t/script-for-setting-platform-exclusion-on-all-instances-of-an-effect/20945/2 "2023-12-05T17:14:53Z")

</div>

I found a lead on this, but am not as sure about the specific modification of platform exclusion in a way that is safe.

> [@FMOD JS Scripting - Getting effect properties from plugin effect](https://qa.fmod.com/t/fmod-js-scripting-getting-effect-properties-from-plugin-effect/18456/2):
>
> To get the settings of the Oculus effect, you need to iterate through each of the plugin’s parameters. Try this bit of code: var selectedEvents = studio.window.browserSelection(); selectedEvents.forEach(function(event) { var effectChain = event.masterTrack.mixerGroup.effectChain; var effectChainEffects = effectChain.effects; effectChainEffects.forEach(function(eventEffect) { if(eventEffect.isOfType("PluginEffect")) { …

Using something like this, I can see what platform are excluded. It looks like this is not a pluginParameter though and changing it would mean changing several values? Ideally, I want to safely switch what platforms are excluded and not.

```auto
studio.menu.addMenuItem({
    name: "Disable Oculus Spatitalizers",
    execute: function() {
		var selectedEvents = studio.window.browserSelection();
		selectedEvents.forEach(function(event)
			{
				var effectChain = event.masterTrack.mixerGroup.effectChain;
				var effectChainEffects = effectChain.effects;
				effectChainEffects.forEach(function(eventEffect)
					{
						eventEffect.excludedPlatforms.forEach(function(excludedPlatforms) 
						{
							console.log(excludedPlatforms.dump());
						});
					});
			});
    },
});

```

---

_[View the full topic](https://qa.fmod.com/t/script-for-setting-platform-exclusion-on-all-instances-of-an-effect/20945)._
