Get player namer and realm macro commands?

title says it,how do i do it?

/run local name, realm = UnitName("player"), GetRealmName() print(format("Name: %s, Realm: %s", name, realm))

thank you,now need to figure how to use that with whisper lol

See the Whisper example.