List cameras

Got tired of the never ending task of going to panels>perspective>select camera so wrote a little python script for it instead.

This one creates a window that lists all the cameras in the scene and allows you to jump between them by simply selecting them in the window. Great time saver.

##
## listCameras
## -------------
## 18 oct 2009
## Jan-Erik "Jonne" Östman (jonne@jonne.net)
##
## www.jonne.net
##
## Description:
## ------------
## PYTHON script for creating a list of cameras in the scene
##
##
## Instructions:
## -------------
## Creates a window that lists all the current cameras in the scene.
## Simply click the desired camera to look through it.
##
## -------------------------------------------------------------------------

import maya.cmds as mc

def lookThruSelectedCam():
	selectedCamera = mc.textScrollList ('cameraList', q=1,si=1)
	mc.lookThru('perspView', selectedCamera)

def getCameras():
	cams = mc.listCameras(p=1)
	return cams

## Check for existing window
windowName = 'camListWin'
if (mc.window(windowName, exists=True)):
	mc.deleteUI(windowName, window=True)

## Create window and scrollist
mc.window( windowName, title="Cam list", widthHeight=(80, 150) )
mc.paneLayout()
mc.textScrollList( 
			'cameraList',
			numberOfRows=8, allowMultiSelection=0,
			append=getCameras(),
			selectCommand=lookThruSelectedCam
			)
mc.showWindow()
I wish to do something Great and Wonderful, but I must start by doing the little things like they were Great and Wonderful”
~ Albert Einstein