Caution in upgrading to El Capitan

 From:  Michael Gibson
7643.11 In reply to 7643.10 
Hi Finema - over here your script seems to be working ok, but only when the mouse is actually over top of the maximized viewport.

That's because the script is calling moi.ui.getViewportUnderMouse() , which will only return the viewport that is directly under the mouse cursor. You probably want to switch that to instead use moi.ui.getActiveViewport(), which will return the last clicked viewport or the maximized viewport if the mouse cursor does not happen to be over a viewport right then. So try this instead:

script:if ( moi.ui.mainWindow.viewpanel.mode != 'split' ) { moi.ui.mainWindow.viewpanel.mode = 'split' } else { var viewport = moi.ui.getActiveViewport(); if ( viewport ) { viewport.viewPanel.mode = viewport.name } }

- Michael