However, coming from Istanbul a direct bus (or a bus from Sofia) might be worth considering since there is no direct train connection.
Have a look at the map here: http://www.raildude.com/en/train-ticket ... -of-europe
By train, you have to travel by overnight train (attention, bus replacement service in operation http://www.raildude.com/en/istanbul-cut ... /news/n/21
to Sofia, then again by overnight train in direction of Beograd. Change in Nis for the train to Skopje.