Allan Troup signed Kenneth McEwan up with an online dating agancy
A company director who enrolled a business associate with a dating agency after they fell out has been given 240 hours of community service.
Allan Troup, 33, sent e-mails demanding money from Kenneth McEwan and signed him up to the dating website.
They fell out after Mr McEwan hired security boss Troup to probe "marital suspicions" in his personal life.
Troup, from Livingston, admitted a breach of the peace charge at Edinburgh Sheriff Court last month.
Troup bombarded Mr McEwan with e-mails and threatened to reveal what he had investigated.
The men became friends in 2005 after Mr McEwan became a customer of a cleaning company run by Troup and his wife.
The following year, Mr McEwan asked Troup to look into his personal affairs, and gave him computer passwords and access to his mobile phone.
Afterwards there was no contact between the men for some time, said fiscal depute John Kirk, prosecuting.
Solicitor Robert More, defending, said Troup had carried out "petty revenge on someone he had held in high esteem" and was now "embarrassed and ashamed" of his behaviour.
He said the married father-of-two, who is the managing director of his own CCTV security firm, had been a close friend and "confidante" to Mr McEwan.
Mr More said: "He accepts that the manner in which he responded was totally over zealous and completely unacceptable."
He said the pair had since bumped into each other by chance in a shopping mall and "expressed regret" over what had happened.
Sheriff Nigel Morrison, QC, said he was not going to jail Troup, and instead imposed the community service order.