A 43-year-old man was shouting and swearing in the street at police when children were playing nearby.

Andrew Dempster, formerly of Alexander Place, Rosyth and now of The Beveridge Park Hotel, Kirkcaldy, appeared at Dunfermline Sheriff Court to be sentenced for two offences.

He admitted that on July 11 last year at Alexander Place he acted aggressively towards two police officers by repeatedly shouting and swearing.

Depute fiscal Jennifer Berner said this incident happened at 4.30pm when there were children playing in the street.

Police were called to a disturbance and found Dempster shouting and swearing, and he continued to direct abuse at the officers.

Dempster also admitted that on May 8 at Alexander Place, he repeatedly sent text messages to his former partner, made threats of self-harm and placed her in a state of fear and alarm.

The depute said: “She didn’t want him living at her home because of his chaotic lifestyle and threw him out. He was living in homeless accommodation.”

Sheriff William Gilchrist imposed a community payback order with 18 months of supervision.