Trigger a "File/Save" action?

Post Reply New Topic
RELATED
PRODUCTS

Post

Just getting started with this, really.
From a js script, is it possible to initiate a "File/Save" action, or menu action generally, or emulate a keyboard shortcut to a menu action?

Post

I'm looking at java, now.
I see there is the possibility of issuing hotkeys for Bitwig menu commands by computer keyboard emulation via a gui automation class such as AWT Robot. There must be plenty of similar classes out there. Would want to be lightweight.
Or maybe there is a better approach.
Does the Bitwig API provide built in support for this?

Post

Couldn't instance AWT Robot due to "headless environment".
However I discovered the much better way (eventually, the doc is terse!):

Code: Select all

	final ControllerHost host = getHost();      
      final Application app = host.createApplication();
      final Action [] list;
      list = app.getActions();
       for(int i=0;i<list.length;i++) {
    	    if(myStringMatch("Save as...",list[i].getName())) {
    	   	host.println(list[i].getName());
      		list[i].invoke();
      		}
      	}

Post Reply

Return to “Controller Scripting”