Take 1 pair of shorts and 3 jumpers. Scotland has unpredictable weather because of the large number of microclimates and particularly in the West there is greater fluctuation in precipitation. Nothing works against midges so once it gets to dusk and you're in a midge area, stay indoors. Not even dogs will go outside when theres a midge swarm. Midges are rare in any sort of urban area though.
In Edinburgh, be sure to see The Castle, the Royal Mile, the Camera Obscura, Princes Street and the Monument. Half of Edinburgh is being dug up for tramworks at the minute so traffic is hellish in places, but the festival is over so its not the 9th level hell it has been lately. If you fancy a drink of a night in edinburgh, Rose Street makes for a lovely self contained little pub crawl. And the core of Edinburgh is good walking streets and mostly pedestrian friendly. Taxi fares are very reasonable and there is a good bus service too.
I'm ill informed to give advice on Glasgow except to say avoid the place. I've never liked the city.
If you're planning to visit Dundee, spend an extra day in Edinburgh instead. Ditto Perth, which is mainly made of mobile phone shops.
Generally you'll be alright this time of year. The weather will be milder and slightly drier, and you'll not freeze unless you're up on high ground and or exposed.