They occupied Edinburgh (but not the castle) and defeated a government army at the Battle of Prestonpans.
The castle was pretty much left unscathed during this time. 
mnli hypothesis: The castle was pretty much left unscathed during this time.  premise: They occupied Edinburgh (but not the castle) and defeated a government army at the Battle of Prestonpans.