The office appeared in the 14th century (or earlier) when it was combined with that of Keeper of the Privy Seal. Called Clericus Regis (although some have applied that to the Lord Clerk Register), he was regarded as an Officer of State. The Secretary was constantly to attend the King's person, receive the petitions and memorials that were presented to him, and write the King's answers upon them. All Letters Patent passed through his hands, and were drawn up by him as with all the King's letters and dispatches, warrants, orders, &c. In the case of lengthy documents a short docket was also subscribed by the Secretary for the King's perusal, as a summary; and as all the writings signed by the King came through his hands, he was answerable for them if they contained anything derogatory to the laws or the dignity of The Crown.
From 1626 until their respective deaths, King Charles I divided the duties between two Secretaries, the Earl of Glencairn and Sir Archibald Achison of Glencairn.
The Secretary did not invariably sit in the Parliament of Scotland after 1603, because his duties normally involved his attendance upon the monarch who was thereafter resident in England. Between 1608 and 1640 there were often two Secretaries, which became normal practice after 1680, although only one could sit in Parliament.
The office was abolished as such in 1709, though from then until 1725 and again from 1742 to 1746 there was a third Secretary of State with particular responsibility for Scottish affairs, for those posts, see Secretary of State for Scotland.