Was trying to troubleshoot around this one. Lets say I have Tank(partyleader) and Healer. With Trust set up already, i think this code, when run from the Tank, will create a macro on the healer that will cast heal on the tank.
Code:
/rpc Healer CreateMacro("Heal1", 1, "/cast [target="+UnitName(Party1)+"]heal", 1, 1)
If we add another member, say DPS, then it would look like this.
Code:
/rpc Razorbax CreateMacro("Heal2", 1, "/cast [target="+UnitName(Party2)+"]heal", 1, 1)
You would probably have to run something like....
Code:
/rpc Razorbax DeleteMacro("Heal1")
....first, but i think has promise.....

NB. I am not a coder so I won't take offence to being corrected