a little digging around the webs gave me this.

/script TargetUnitsPet("X")

x can be player, party1, target, targettargettargetetc, focus, or the actual name of the player.