Dalrymple was a Shire commissioner for Ayrshire in the Parliament of Scotland from 1702 to 1707. He was a court representative there who made little contribution. He was appointed joint muster master general for Scotland in 1706. He followed the Court line faithfully over the Union, and was appointed a commissioner of the Equivalent in 1707 and as one of the Scottish representatives to the first Parliament of Great Britain from 1707 to 1708. At the 1708 British general election he was returned in a fierce contest as Member of Parliament for Clackmannanshire. He was supported by Lord Mar, the principal magnate in the shire, who was said to have created some ‘fictitious votes’ for him. There was a petition but it was ignored. He was Sheriff of Clackmannan from 1708 to his death. In February 1709 Dalrymple was granted a vacant company in the 3rd Foot Guards (Scots Guards), at the request of his father. He probably did not go to Spain with his regiment, and so avoided its surrender at the Battle of Brihuega. He continued to support the Court in Parliament and presented documents from the Equivalent commissioners on 3 March 1709. In 1710 he voted for the impeachment of Dr Sacheverell. Clackmannanshire did not elect at the 1710 British general election and Dalrymple was no longer on good terms with Mar by the time of the 1713 British general election.