I am a junior on mod writing.I noticed that there were item id and skill id.Now many mods can show item id,and we can use it in macros and so on. But how about the skill id?I know it can be found at some wow database websites,but how do they get this information?And is there other way to find a skill's id?

I am sorry but the code is not correct.Yes,the "skill id" is "SpellId".After seen the code,I checked at wowwiki to find the API.And there is code as above but using "GetSpellInfo(SpellID)".It seems you mixed "GetSpellLink(SpellName,SpellRank)"and"GetSpellInfo(SpellID/SpellName/SpellLink)" together.Then the experiment in game also failed.

Just now I saw this setence:
"spellID is the index of a spell in a spellbook. The indices increase from top to bottom, then left to right, then between categories (e.g.: General -> Discipline). spellIDs will change as players learn new spells and professions. "

__________________
"You'd be surprised how many people violate this simple principle every day of their lives and try to fit square pegs into round holes, ignoring the clear reality that Things Are As They Are." -Benjamin Hoff, The Tao of Pooh

local i = 1
while true do
local spellName, spellRank = GetSpellName(i, BOOKTYPE_SPELL)
if not spellName then
do break end
end
DEFAULT_CHAT_FRAME:AddMessage( spellName .. '(' .. spellRank .. ')'..'SpellID:'..i )
i = i + 1
end

Can I in this way get the SpellID which can be used as the item id in macros in the form of "item:id"?