CONTACTING a witness and asking her to drop charges led to a Kinglassie man narrowly avoiding a jail sentence.

John Beattie, 37, of Hillside Terrace, was told he had been "on the cusp" of being sent to Perth Prison when he appeared at Dunfermline Sheriff Court on Wednesday.

Appearing in the dock for sentencing, he had admitted breaching a bail condition which stopped him from approaching or contacting a female witness when he contacted her asking him to drop the charges against him on January 31.

Depute Fiscal, Alistair McDermott, said the bail conditions been imposed on January 25.

He called the woman from a withheld number and asked her to drop the charges.

He did so again soon after, telling her he needed to "get out of Fife" and repeatedly asked her to drop the charges.

Solicitor, Peter Robertson, said his client had no recollection of making the phone calls and asked the Court to accept the offence was an "aberration of his character."

He added: "He advises on that day he had been drinking and had had more than one bottle of vodka. He also had been taking anti-depressants. He recognises that drinking alcohol to that extent is a danger.

"He has taken that on board and there have been no further allegations since then."

Sheriff James Macdonald told Beattie that he had been attempting to obstruct justice.

"This was not just a breach of bail conditions but a breach which had a clear motive which was self serving on your part," he said. "This Court will deal seriously with any person who seeks to obstruct justice or frustrate a criminal trial.

"The offence was further aggravated as the bail order was just one week old when you committed this breach. Appearing as a first offender, you are fortunate in that case. I am persuaded that I can stop short of a custodial sentence.

"You are on the cusp of going to Perth Prison and you should realise how close you have come to that."

He placed Beattie on a community payback order requiring him to do 180 hours of unpaid work within nine months.