Thanks a lot, but it has the problem of joining only 9 channels, would you be so kind as to add the second while so that it joins the channels in strings of 5 each time?

eg if you have 13 favourite channels it would do:
/join #channel1,#channel2,#channel3,#channel4,#channel5
/join #channel6,#channel7,#channel8,#channel9,#channel10
/join #channel11,#channel12,#channel13

Thanks!