Small problem with toggleRecording() (Scripting API)

I’m doing some experiments with the Scripting API. I want to create a ProfilerSession, start recording on the session and go back to the selected Event in the Event Editor. It works if I input the code in the console, but when launching a .js script it seems like it can’t find the event object after calling toggleRecording. Using FMOD Studio 2.00.5.

This is a minimal code snippet to reproduce the issue:

    var event = studio.window.browserCurrent();
    var session = studio.project.create("ProfilerSession");

    studio.window.navigateTo(session);

    session.toggleRecording();

    studio.window.navigateTo(event);

Video of the behaviour when using the console:
https://streamable.com/jyiqv

Running a script:
https://streamable.com/korld

What do I want to finally do with this code in the first place? I was planning to play with effects/modulations while the profiler is running, stop the recording and auto import the recorded .wav file from the profiler session into a new Event. It works great when copy+pasting the final code into the console, but doing that with a script that can be called with a shortcut would be even greater. It’s not very important (just experimenting), but thank you if you could look into it :slight_smile:

It looks like there’s a small bug when running these commands as a script. Basically navigating back to the event window is happening too quickly. I’ve logged a bug about this and we’ll look into it for a future release.

1 Like