WoW:API GetNumCrafts
numberOfCrafts = GetNumCrafts();
This function returns the number of crafts in the currently opened crafting window. Usually used to loop through all available crafts to perfom API GetCraftInfo on them.
This is part of the World of Warcraft API