# Can i duplicating event in script?

**URL:** https://qa.fmod.com/t/can-i-duplicating-event-in-script/19941
**Category:** FMOD Engine
**Created:** [March 6, 2023, 1:11pm UTC](https://qa.fmod.com/t/can-i-duplicating-event-in-script/19941 "2023-03-06T13:11:10Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![MaggieW](https://avatars.discourse-cdn.com/v4/letter/m/fbc32d/32.png) [@MaggieW](https://qa.fmod.com/u/MaggieW)
#### Post date: [March 6, 2023, 1:11pm UTC](https://qa.fmod.com/t/can-i-duplicating-event-in-script/19941/1 "2023-03-06T13:11:10Z")

</div>

i want duplicate event in script, like context menu “duplicate” , then only replace audio asset in event

---

<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: [March 8, 2023, 2:47am UTC](https://qa.fmod.com/t/can-i-duplicating-event-in-script/19941/2 "2023-03-08T02:47:34Z")

</div>

Hi,

You can duplicate an event via script by selecting your event and calling `studio.window.triggerAction(studio.window.actions.Duplicate);`. To select an event from a script, you can get an array of all events using `studio.project.model.Event.findInstances()`, get your event from that list, and then use `studio.window.navigateTo(yourEventhere)` to select the event in the Event Browser.

However, I definitely feel like there should be a way to do this via the Scripting API that doesn’t explicitly require you to select an event in the Event Browser, so I’ve flagged this in our internal feature/improvement tracker.

As for replacing audio assets, you’ll need two things: the instrument’s underlying `ManagedObject:SingleSound` object, and the `ManagedObject:AudioFile` of the audio asset you want the instrument to use. From there, you can access either `SingleSound.relationships.audioFile` or `AudioFile.relationships.sounds`, and use [`ManagedRelationship.add()`](https://www.fmod.com/docs/2.02/studio/scripting-api-reference-project-managedobject.html#managedrelationshipadd) on either while passing the opposite `ManagedObject` as an argument. This will replace the existing relationship between the instrument and the old audio asset with a new relationship between the instrument and the new audio asset.

A simple example of changing the audio asset of a Single Instrument on a timeline by script is the following:

```auto
// get the first instrument (single instrument) on the selected event's timeline
var singleSound = studio.window.browserCurrent().timeline.modules[0];
// get the audio asset you want the instrument to use
var newAudioAsset = studio.project.workspace.masterAssetFolder.getAsset("newAudio.wav");

// do one of the below:
// either add a relationship via the instrument
singleSound.relationships.audioFile.add(newAudioAsset);
// or add a relationship via the audio asset
newAudioAsset.relationships.sounds.add(singleSound);

```

If your event has instruments on parameter sheets or an action sheet, then you can access those sheets via the `parameters` property on your event. It’s also worth noting that with instruments that contain a playlist of multiple instruments (i.e. a Multi Instrument), you should be able to access their underlying single instruments via the `sounds` property. In general, you can see the properties and functions of an entity using the `dump()` function.

Hope that helps!

---

<div class="post-metadata">

### Author: ![lucafusi](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/lucafusi/32/681_2.png) [@lucafusi](https://qa.fmod.com/u/lucafusi)
#### Post date: [February 25, 2026, 7:25pm UTC](https://qa.fmod.com/t/can-i-duplicating-event-in-script/19941/3 "2026-02-25T19:25:19Z")

</div>

Just bumping this! Exposing something for duplicating events via the Scripting API would be extremely helpful.

If this has already made it into 2.03 (this post is a few years old, but my project is still on 2.02), then I simply haven’t seen it and oops!

---

<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: [March 5, 2026, 2:24am UTC](https://qa.fmod.com/t/can-i-duplicating-event-in-script/19941/4 "2026-03-05T02:24:37Z")

</div>

This functionality has not made it into 2.03 - I’ve noted your interest on our improvement tracker.
