He only wanted a function to put in the text in the chat box and do nothing more, so here you go mate:
Code:
local function putInChatBox(name)
name = type(name) ~= "string" and "" or name
local e = DEFAULT_CHAT_FRAME.editBox
ChatEdit_ActivateChat(e)
e:SetText("/tdps whisper "..name)
end
-- example: putInChatBox("Vladinator")
The first line makes sure the param is a string, if not it uses a empty string so the function still works.