 The screenplay was written by Compton Mackenzie and Angus MacPhail, based on Mackenzie's novel; Mackenzie received £500 for the rights to the book and a further £1,000 because of the film's profitability.Mackendrick and Danischewsky also worked on the script before further input from the writers Elwyn Ambrose and Donald Campbell and the actor James Robertson Justice, who also appeared in the film.The film and novel's story was based on an incident in the Second World War, when the cargo ship SS "Politician" ran aground off the north coast of Eriskay in 1941 in the Outer Hebrides.