You could take the 747 bus to Inverkeithing rather than backtracking into Edinburgh. It takes 20 minutes but it means catching it by 10:00am as they only run every 30 minutes.
http://www.edinburghairport.com/tran...es-and-coaches
Trains for Aberdeen stop there
http://ojp.nationalrail.co.uk/servic...orrow/0900/dep