A man thought it was his lucky day when he found a bag containing hundreds of pounds dropped at a bookmakers.
But the theft was caught on camera and today Darryl Schofield was ordered to pay back the cash and complete a community order.
The victim, Jane Buckley, was in the Commercial Street shop.
While she was taking money out of her purse she dropped her bag which contained £400 in banknotes.
CCTV footage for the shop showed Schofield, 27, picking up the bag and taking it.
Paul Blanchard, mitigating, said his client should have made enquiries but was suffering from severe debt.
He added: “He thought it was his lucky day to find £400.
“Temptation got the better of him and he understands how this lady must have felt when she lost the money which has all gone on payment of debts.”
Schofield, of Springfield Avenue in Batley, was ordered to complete 80 hours of unpaid work as punishment.
District Judge Michael Fanning acknowledged that the money “fell into” his lap but he was dishonest in not handing it in.
As a consequence Schofield must repay the stolen cash.