Edinburgh council received 298 reports of idling vehicles between 2017 and October 2021, but issued no £20 fixed penalty notices, a Freedom of Information request has revealed.
Glasgow City Council separately said it had spoken to or given advice or a leaflet to 2,144 drivers in the three years to March 2021, but had also not issued any fines.
Aberdeen, Dundee and Fife councils, among the next largest in Scotland, said they had not penalised any drivers.
Aberdeen said drivers switched off their engines when asked by officials.
Friends of the Earth Scotland called on local authorities to enforce the law to improve air quality and health.
Its transport campaigner Gavin Thomson said: “Air pollution from transport is responsible for thousands of premature deaths in Scotland every year, and causes serious heart and lung issues.
"Engine idling is a big part of the problem, with exhaust fumes spewed out onto the street making the air harmful to breathe.
"Enforcing this will also help the public understand the dangers being caused.
"Idling is a particular problem around schools, and given children are among those most vulnerable to being affected by poor air quality, this is really worrying to many parents.
"Councils need to step in and enforce the law to protect our health.”
But Steve Gooding, director of the RAC Foundation, said: "The best tactic is education rather than confrontation.”
Neil Greig, the Scotland-based policy and research director of motoring group IAM RoadSmart, said the focus should be on buses and lorries.
He said: “Enforcement of the regulations for engine idling should be consistent across Scotland and target the most polluting vehicles in locations with the poorest air quality.
"In most cases, these would be buses, lorries and large vans in the middle of our cities.”
But the Confederation of Passenger Transport, which represents bus operators, said they were cleaning up their act.
Scotland director Paul White said: “Bus is the mode that has made the biggest step towards decarbonisation of any form of road transport.
"Operators are also committed to improving the environmental performance of buses by monitoring driving performance and investing in technologies such as stop-start that switches off the engine when the vehicle is stationary.
“Cars are responsible for roughly 50 per cent of all nitrogen oxide emissions and nearly 60 per cent of greenhouse gases from road transport in Scotland, with the bus sector responsible for a tenth of this amount.”
An Edinburgh council spokesperson said: “Our street enforcement officers have the power to issue fixed penalty notices to anyone who fails to comply with a request to turn off their engine, and will continue to advise all drivers that engine idling is an offence, taking appropriate enforcement action if necessary.
"One of the key aims of national legislation is to target serious offenders, in particular where vehicles gather regularly, and in these cases patrols will be put in place to eliminate this practice where appropriate.
“We’re also working with our parking contractor, NSL, to investigate the potential to give enforcement powers to tackle idling engines to parking attendants which, if possible, will significantly increase the number of officers that can deal with this problem.”