Switching between views using key shortcuts?

 From:  Jacob
4818.4 
Since this may be useful to some, here is a single key shortcut for switching over views:

javascript code:
var views = ["split", "3d", "top", "front", "right"];
var vp = moi.ui.mainWindow.viewpanel;
var current = vp.mode;
for (var i = 0, len = views.length; i < len; i++) {
	if (current == views[i])
	{
		vp.mode = views[(i+1)%len];
	}
}


Here's the one liner version for copy-pasting:
javascript code:
script:var views = ["split", "3d", "top", "front", "right"]; var vp = moi.ui.mainWindow.viewpanel; var current = vp.mode; for (var i = 0, len = views.length; i < len; i++) {if (current == views[i]){ vp.mode = views[(i+1)%len]; }}