General

Global variables/scripts in the desktop editor

Started by batmundo on .

Sign in or create an account to join the conversation.

3 posts

Topic starter
I was going to post this in the feedback forum but I can't seem to post there so I'm asking this here instead:

In the desktop editor, would it be possible group variables and scripts into a collapsible folder? It's a bit unwieldy in the current form, as I have a lot of globals going on. The app itself already has them grouped into a "Globals" in the settings, so some kind of similar organizational structure for desktop would be nice...
You can use a Container widget and hide it.

1) Create a container widget by dragging it into the project
2) Create a script on it, set the execution mode to On Load and write the following to hide it in the UI:
show(getobject(), 0); // hides the container
3) Delete the script. It was only needed to hide it, and it will remain hidden until you call show with a 1 as the second argument.
show(getobject(), 1); // shows the container
Keep in mind that this will create a namespace. Your existing scripts will now have to call Object.Container.function().

I do this all the time to group functions together into namespaces. In fact I consider this best practice.
GraphicsHelpers.resetAllGraphics();
MixerHelpers.resetAllFaders();
SongHelpers.loadSong(1);
Oh ok, yeah I had considered doing something like this, I was just wondering since the iPad app already had 'em grouped. I tried it with a blank interface page, but being able to hide it like this is much cleaner. Thanks!