You don't put the whole mel script on the shelf. Just save the script in your scripts folder. Open up the script editor. Type these lines in: source refplanes.mel; refplanes; Select the two lines and MMB drag drop them on to your shelf. (As a matter of fact the first line there is optional...)