A man who smashed the window of a bus he was travelling on by punching it was later found to be in possession of a knife, Selkirk Sheriff Court was told.
James Jackson, 27, of Havelock Place, Hawick, pleaded guilty to committing that offence on an X95 bus near the Asda store in Galashiels on February 3 last year.
The court heard that a disturbance had taken place on the bus involving four males.
They had got off the bus, and Jackson tried to pursue them, punching the glass and shattering it as he did so.
The service bus had to be replaced, and the driver pointed out Jackson to the police as he entered Galashiels transport interchange with blood-stained paper towels around his hands.
After being detained by the police, he was found to be in possession of a knife with a six-inch blade.
Defence lawyer Ed Hulme said his client had no recollection of the incident, adding that he had been suffering blackouts.
Jackson was given an 18-month community payback order with supervision.