But Judge Wade found that although there was no physical contact of any kind between the pair, he was "satisfied beyond reasonable doubt" that McMillan was guilty.
He said that the text messages came to an end on 24 August last year, one week before the girl's father found them on his daughter's cell phone and complained to the school and police.
"I shall assume in his favour that, somewhat belatedly...he realised the folly of what he was doing and voluntarily broke off contact.
"I would be minded not to impose a sentence of imprisonment on this young man. Instead, my present intention is to impose a community based sentence."
At the request of McMillan's counsel the conviction was not technically entered, however Judge Wade noted that the likelihood of a discharge without conviction was "remote in the extreme".
McMillan will be sentenced in September.