In 1680, the Duke of York and Albany arrived in Edinburgh, to supersede Lauderdale, and took up his residence at Holyrood. Dalyell received him at the head of the troops and a body of armed citizens, consisting of sixty men chosen from the sixteen companies of the Trained Bands which lined the streets. After his arrival, he and his Duchess, Marie d'Este of Modena, so celebrated for her beauty, left nothing undone to ingratiate themselves with the Scottish people, to the end that, if excluded by the Act of Succession from the English throne, they might for themselves secure the ancient crown of Scotland. Everything was studied, done, and adopted to ensure popularity; and one fact is certain, that after the Duke's arrival the persecution of the Covenanters was much less severe than before. By ostentatious pageants, he revived in the nation what it was even then beginning to forget, the memory of its regal independence and the pride of better days; and thus he sought to make his family less abhorred in the hearts of the people. He projected many improvements at Edinburgh. Among others, the plan for building a bridge across the North Loch, and having a new town built upon the northern ridge; and the Holyrood parties, where tea was seen for the first time in Scotland, the balls and masques of the Ladies Anne, afterwards of Denmark, and Mary, afterwards of Orange, were long the theme of aged demoiselles and stately dowagers in Edinburgh, where the beauty and charming suavity of the young princesses, with their natural gaiety, brightened the gloomy towers and tapestried rooms of the ancient palace: and the memory of these things was transmitted by many a mother and grandmother to their little ones, when the last of that old royal race was far away in hopeless exile and obscurity, and the first grass of spring was sprouting on the graves of Culloden.

The Duke of York and his Duchess are said to have been warned of the lofty spirit and haughty punctilio of the old Scottish aristocracy from a speech of General Dalyell.

James had invited this stern and bearded cavalier to dine with them at Holyrood soon after his arrival; but the Duchess Mary, as a daughter of the ducal Prince of Modena, seemed to consider it somewhat derogatory to her rank to sit with a subject at table, and declined to take her place.

"Madam," said the old veteran, "I have dined at a table where your father must have stood at my back."

In this instance it is supposed that he alluded to the board of the Emperor of Germany, whom the Duke of Modena, if summoned, must have attended as an officer of the household. Abashed by the firm retort of this grim old man, the haughty princess at once took her seat, and from thenceforward she and her husband resolved, in their intercourse with the Scottish noblesse, to exercise all the suavity and affability they could command. By various acts of leniency the Duke also sought to win favour.

"General Dalyell," says old Lord Fountainhall in his Diary, "having caused to be condemned by court martial a sentinel who had been found sleeping at one of the gates of the Abbey, the Duke caused him to be remitted and forgiven all punishment."

In this year, soon after the Duke's arrival, the services of the General were required to repress a dangerous demonstration among the students of the Edinburgh University. Being deeply imbued with the sentiments of the Covenanters, on Christmas Day, 1680, these young men resolved to manifest publicly their horror of all prelacy, by burning an effigy of the Pope, a ceremony eminently calculated to offend the royal Duke, as a zealous Catholic; and the magistrates, having resolved at all hazards to prevent this impolitic display, immediately communicated with General Dalyell, that he might have the troops in readiness to overawe the city. In furtherance of their daring scheme, the students posted on all the gates and public places of Edinburgh the following curious placard:—

"AN ADVERTISEMENT.

"These are to give notice to all noblemen, gentlemen, and citizens, that we, the students in the Royal College of Edinburgh (to show our detestation and abhorrence of the Romish religion, and our zeal and fervency for the Protestant), do resolve to burn the effigies of Antichrist, the Pope of Rome, at the Mercat-cross of Edinburgh, at twelve o'clock in the forenoon—being the festival of our Saviour's nativity. And since we hate tumults as we do superstition, we do hereby, under pain of death, discharge all plunderers, robbers, thieves, whores, and bawds to come within forty paces of our company, and such as shall be found disobedient to these our commands, sibi caveant.

"By our special command, Robert Brown, Secretary to all our Theatrical and Extra-Literal Divertisements."

By an oath, the students bound themselves to stand by each other, under a penalty, and employed a carver in wood to make them an effigy of his Holiness, "with clothes, triple crown, keys, and other necessary habiliments."

The Lord Provost, Sir James Dick, reported their intentions to the Duke of York, and threatened that "he would make it a bloody Christmas for them;" while Dalyell marched all the troops from Leith into the Canongate. The Grassmarket, an old quaint street lying to the south of the Castle rock, was filled with troops, whose patrols scoured all the wynds and closes, as the narrow alleys of the ancient city are named. The militia, or trained bands of Edinburgh, occupied the High-street; guards were placed on the College, which stood without the walls, and those at the palace were doubled for additional security to the royal duke and his family.