You don't really want to put this script on your shelf unless you have made a user interface for it, as it requires a camera name on the command line.
Drag both MEL files into somewhere in your script path (usually the maya/scripts directory under your home directory is a good place) and relaunch Maya. Then, type this:
addCameras("persp");
(replacing persp with your camera name)
then hit enter on the numeric keypad. Unless you always run this command on the same camera name, putting it on the shelf wouldn't help you, because you'd have to have a separate button for each camera name.
Of course once you've put the MEL files in your script path you could always drag these lines to your shelf instead:
Code:
string $result = `promptDialog -t "Pick a camera"
-m "What camera would you like to add?"
-tx "persp"
-button "OK"
-button "Cancel"
-defaultButton "OK"
-cancelButton "Cancel"
-dismissString "Cancel"`;
if ($result == "OK") {
string $theCam = `promptDialog -q`;
print ("Calling addCameras for camera " + $theCam + "\n");
addCameras($theCam);
}
-- Mark