Transfer the uv's of one object to other selected objects

'''
uvTransfer.py v1.0

Author: Nate Lang
web: natelang3d.com

Install: Copy + paste this code as a python button on your shelf

USE: 
1) Select first object with the UV's you want.
2) Add to your selection any objects you wish to
transfer your UV's too
3) Run Script
'''

from maya import cmds

toUv = cmds.ls(selection=True)
sourceUV = toUv[0]

for each in toUv:
    if each == sourceUV:
        pass
    else:
        print each
        cmds.transferAttributes(sourceUV, each, transferUVs=2, transferColors=2, sampleSpace=4, sourceUvSpace='UVChannel_1', targetUvSpace='UVChannel_1', colorBorders=1)