How to assign event to bank from console

I’m writing a solution for adding an audio file to a bank from console

loadedAudio = studio.project.importAudioFile("path");
event = studio.project.create("Event"); = "Name";
track = event.addGroupTrack("Audio track");
sound = track.addSound(event.timeline, 'SingleSound', 0, loadedAudio.length);
sound.audioFile = loadedAudio;

bank = studio.project.lookup("bank:/Master");

now I need to assign this event to a bank
I’m trying; but nothing happens, event is still unassigned

You can assign events to banks using event.relationships.banks.add(bankObject) or . You need to pass the actual bank or event object into the function for it to work.

1 Like