Glasgow- you dock at Greenock. It is a short signposted walk from the cruise terminal to Greenock Central for frequent (two or three an hour) trains to Glasgow Central (35 minute journey)
Kirkwall- Orkney Islands- depends if you are berthed or anchored with tenders ashore. Your cruise company will tell you which. If tendered you arrive right in the town centre. If berthed you dock two miles out of town at Hatston Deep Water Ferry Terminal. A cruise shuttle bus takes you into to the bus station (often on bendy buses).
Edinburgh- there are four possibles (you need to ask which)-
North Queensferry (tender port)- a shuttle bus takes you into the city centre, journey time 30 to 40 minutes (pay on the bus, tickets include all city buses that day); or walk up a long, long flight of steps to Dalmeny Station. Hint- the bus is the sensible option.
Newhaven (tender port)- Tram from it's terminus to the City Centre
Leith (berthed alongside, small ships only)- the Tram again
Rosyth (berthed alongside)- the worst place possible. You are NOT allowed to walk from the ship to the terminal or the terminal to the dock gates. You will be bussed to the terminal. No bus runs to the dock gate. Even if it did it is a very long walk to the closest bus stop or rail station. There should be a shuttle bus over the Forth Bridge into Edinburgh (journey 30 to 40 minutes at the cruise company discretion). If it runs you will only be told the previous night. So from Rosyth (if that is where you dock) take a cruise excursion even if it is just into the City. Rosyth is terrible- was far better when it was a ferry port.
EDIT-
Edinburgh- If tendering the Firth of Forth does whip up and tendering can be unsafe- in that event the call is abandoned.
Orkney- If tendering please be aware that it is a difficult anchorage. I've been on a cruise where we anchored late due to condition and tenders ashore then took for ever. Lots of passengers were too late ashore for booked rental cars or private excursions outside Kirkwall (losing their money). The weather got worse during the afternoon and tenders had to end very early. The ship was frantically contacting people. Anyone who had been the other end of Orkney Mainland would have been in trouble. So plan your day sensibly. Personally I got about 90 minutes ashore. In certain weather just getting into the Harbour is not possible, so berthing is not certain either.