tinyu: that's not how SendChatMessage() works, nor is it what GuildControlGetRankName() is for.
makaka: This is untested, but really should work.
Code:
/run for i=1,select(2,GetNumGuildMembers()) do local n,r=GetGuildRosterInfo(i) if r="Newbie" then SendChatMessage("TEXT MESSAGE","WHISPER",nil,n) end end
GetGuildRosterInfo has many returns. The first is name, and the second is rank. As your script goes through the loop, it assigns that member's name to the variable
n and their rank to the variable
r. If the rank is "Newbie" (or whatever you want to replace that with) then it will send the message. I also tightened it up a little bit more. As written, if your rank name is "Newbie" or another 6-letter name, you have 114 characters to use for your message.