MacGregor served as assistant district commissioner of
Southern Nigeria from 1912 to 1914. In 1914 he was appointed a police
magistrate at
Lagos and served in that position for 8 years. In 1922, he was appointed as
Crown counsel and
solicitor-general of
Nigeria and served in that position until 1926. He was transferred to
Trinidad in 1926 and then to
Kenya in 1929. In both places, he served as the
attorney-general. He was made a
King's Counsel in 1927 while serving in Trinidad. , Judge of the
British Supreme Court for China, at the
Fujiya Hotel, Japan 1935 In 1933 MacGregor was appointed
Chief Justice of Hong Kong in succession to
Joseph Horsford Kemp. As Chief Justice he was reported to "have won golden opinions on the bench where he has displayed abilities of a high order, whilst socially also he has shown himself to be a man of marked charm of personality." In his capacity as
Chief Justice of Hong Kong, he also sat as a member of the
full court of the
British Supreme Court for China in Shanghai. MacGregor was knighted in 1935. In 1937, he was appointed chairman of a committee to study restoration of allowances to Malayan civil servants. He was made a Commander of the
Grand Priory in the British Realm of the Venerable Order of the Hospital of St John of Jerusalem in 1940. ==Internment by Japanese during World War II==