Macro to display / craft

I have a similar macro for making mooncloth. I think the easiest solution is to just use the profession skill above the other part of the macro. For example this is my macro for mooncloth:

/use Tailoring
/run for i=1,GetNumTradeSkills() do if GetTradeSkillInfo(i)=="Mooncloth" then DoTradeSkill(i, GetItemCount("Mooncloth")/5) break end end 

The only downside I guess is that it opens the crafting window and you have to close it again but that doesn’t bother me too much.