A customer at a Fife library had his car keys stolen from his jacket and then watched out of the window as his vehicle was driven away.
Drug addict John Boyle had stolen the keys and later crashed the car, causing extensive damage to it.
Boyle, 35, of Timmons Park, Lochgelly, admitted that on December 22 2014 at Lochgelly Library, Bank Street, he stole a mobile phone and a car from the Lochgelly Centre car park.
He further admitted driving without a valid driving licence and also without insurance.
The court heard that Boyle was a drug addict who had relapsed into drug misuse at the time of the offence.
Depute fiscal Azrah Yousaf told Dunfermline Sheriff Court that the vehicle stolen was a Skoda Octavia and its owner had gone into the library where he had hung his jacket on the back of a chair and sat down.
She said that Boyle came in later and sat down next to the man briefly before leaving, stealing the phone and keys without the victim realising at the time.
She explained that the man only realised what had happened when he looked out of the window.
“The owner then looks up and sees his car being driven away,” Ms Yousaf said.
She added that police later came across the car, which had been extensively damaged, and that Boyle was not there but was later traced.
Boyle appeared from custody as he is currently serving a six-month sentence for shoplifting.
Sheriff Charles Macnair jailed Boyle for another six months to run consecutive to his current term. He was also banned from driving for 16 months.