In 1938, the Colonial Office posted MacGillivray to British Palestine, "in accordance with the Colonial Office policy of staffing that difficult territory with some of its best administrators." He served as colonial secretary in Jamaica from 1947 to 1952, and was considered in line for a governorship, briefly serving a stint as acting governor in 1948. However,
Oliver Lyttelton, 1st Viscount Chandos selected MacGillivray to serve as deputy high commissioner to General Sir
Gerald Templer British High Commissioner in
Malaya, where a state of emergency existed. MacGillivray was the only colonial administrator who openly discussed Malaya's independence with the Malays. He served Malaya from 1954 until 1957. After celebrating Malaya's independence (
Hari Merdeka), MacGillivray was accompanied by the
Yang Di-Pertuan Agong of Malaya and his consort, together with Malaya's first prime minister,
Tunku Abdul Rahman to board the plane in
Sungai Besi Airport. MacGillivray also served as the Chairman of the State Council of British Colony of Kenya, which then had five European and six Non-European members. This was almost similar with what he chaired during his administration in British Malaya, where a Legislative Council for the Federation of Malaya was formed, with appointed local and European council members. On 5 August 1957, he signed the Federation of Malaya Agreement, 1957. In 1960, he was appointed to the
Monckton Commission to review the constitution of the
Central African Federation. He died on 24 December 1966 at
Nairobi Hospital, after a long illness. ==Honours==