'''
moveToSelected.py v1.0
Author: Nate Lang
web: natelang3d.com
Install: Copy + paste this code as a python button on your shelf
USE:
This allows you to move one object to another object. Effectively
copying the attributes in the channel box from one to the other.
'''
from maya import cmds
objList = cmds.ls(selection=True)
parentObj = objList[0]
childObj = objList[1]
#select parent then child
tempParCon = cmds.parentConstraint(parentObj, childObj, maintainOffset=False)
tempScaleCon = cmds.scaleConstraint(parentObj, childObj, maintainOffset=False)
cmds.delete(tempParCon)
cmds.delete(tempScaleCon)