Dunfermline Sheriff Court was told of the incident at school closing time.