|LV= County Championship Division One, Scarborough|
|Close, day two: Yorkshire 253 & 29-1 v Middlesex 232|
|Yorkshire 5pts; Middlesex 4pts|
Middlesex's John Simpson struck a fine century but Ryan Sidebottom's 7-44 ensured that Yorkshire had the better of things at Scarborough.
The hosts had resumed day two on 211-6, but slipped to 253 all out as Steven Finn took 4-81.
Middlesex then collapsed to 11-4 in reply, before Simpson (110) combined with Dawid Malan (78) to share 168.
However, once the latter fell they were skittled for only 232, before the Tykes reached stumps on 29-1, a lead of 50.
Adam Lyth, who struck 117 in the first innings, was the only man to be dismissed as Yorkshire were left to bat out a tricky 13-over spell before the close of play.
The Division One title hopefuls will now hope to compile a big total on the third day as they seek to return to the top of the table.
Their lead may already be far greater had they built on their advantage earlier in the day, when Chris Rogers, Nick Gubbins and Eoin Morgan all fell for ducks to leave Middlesex struggling.
But Simpson, whose 155-ball innings included 17 fours and one six, and Malan led a superb recovery, taking the visitors to within 74 runs of Yorkshire's first-innings score only for Sidebottom to end their partnership and spark another collapse, as only one other batsman - Tom Helm (11 not out) - made it into double figures.
BBC London 94.9's Kevin Hand:
"Yorkshire have their noses in front after a riveting second day at Scarborough that saw 15 wickets fall.
"Middlesex made short work of the hosts' tail and would have been delighted to wrap up their first innings for 253, having let them escape to the false position of 177-2 yesterday afternoon.
"The pitch has been lively for the new ball at the start of the day and then also for the older ball in the evening session - presumably when the tide has come in at this seaside ground.
"Dawid Malan was softly put down on seven, off the bowling of Jack Brooks by Jonny Bairstow, with the score on 11-3 and Paul Stirling fell without any addition to the score to the excellent Ryan Sidebottom. It was a costly drop as Malan and John Simpson grittily built a partnership and then put the bowlers to the sword when batting became easier in the middle of the day.
"The dramatic collapse by the visitors in the evening proved there was plenty in this pitch, which still has more than a greenish tinge and if Yorkshire can build a lead of more than 200 then they will be heavy favourites for victory.
"Early scalps are crucial for Middlesex on the third morning or control will slip from them by the afternoon."