Exclusion Crisis
The King sent his brother and heir to Edinburgh largely to remove him from London as a result of the Exclusion Crisis of 1679–1681, during which the English "Country Party" attempted to exclude the openly Catholic James from the three British thrones. He took up residency in Holyrood Palace the early 1680s, running what was in effect a small court.