The 20-year-old was left deflated earlier this summer when Kilmarnock boss Lee Clark decided he could do without his services at the back.
But Hartley moved sharply to snap O’Hara up after spotting his potential to make the grade as an attacking midfielder.
And so far the change of position has paid off, with the former Rugby Park right-back netting his first senior goal in the defeat to Rangers last week.
He also put in an impressive display in the Dark Blues’ Ladbrokes Premiership curtain-raiser away to Ross County and Hartley believes the youngster will only get better and better.
He said: “I love having Mark involved right now. He’s been a breath of fresh air for the team.
“He’s a brilliant young professional and has a great attitude and work ethic.
“He also has great qualities about him. How he was a right-back or a centre-half I’ll never know because I see this kid as an attacking midfield player.
“He’s 6ft 2ins, can run box to box and with real good quality on the ball. He needs to add goals to his game. That was his first senior goal last week in 80 games. In fairness he was playing at the back before but I’ve set him a target of 10 goals.
“When I looked at him I just felt there was a change of position needed. I watched him in the play-off game against Falkirk last year and I just felt he was restricted.
“And fair play to him, he has so far stood up to the challenge. He was pretty low when I tried to sign him but we had a good conversation. I told him to come in here and enjoy it and that I’d try to help him, because I know what he can be.
“When I told him what I had in mind he couldn’t wait to get started. We have taken the shackles off him and told him to go be what he can be.
“If he keeps progressing then he can be anything he wants to be.”
O’Hara’s emergence as a threat going forward has come just at the right time following Kane Hemmings and Greg Stewart’s moves south.
Now Hartley has challenged the rest of his fringe men to stake a claim for the spots left behind by the departing duo when they welcome Hamilton to Dens Park on Friday night.
“We need to forget Stewart and Hemmings,” said the Taysiders’ boss. “It’s up to the other players to step up and perform.
“We have some good players here and we want to add to the group, so it is up to the guys coming in to show us what they have got.
“We’re just looking to find that consistency. I felt we were disappointing in the first half against Rangers. It was nothing to do with the lads moving on, we just didn’t do our jobs properly.
“But the second half was good, just like the game at Ross County.
“These home games are important for us, it’s vital to get three points.”