Scottish Amateur Cup holders Colville Park were handed a home tie against Cumbernauld Colts, while Scottish Junior Cup winners Glenafton Athletic will face Glasgow University or Threave Rovers in the first round of the Scottish Cup.
The draw took place at Excelsior Stadium on Saturday afternoon, with three all Highland League ties picked out the hat.
Scottish Cup first-round draw in full:
Selkirk v Gretna 2008
Colville Park v Cumbernauld Colts
Fraserburgh v Forres Mechanics
Edusport Academy v Rothes
Civil Service Strollers v Strathspey Thistle
Nairn County v Whitehill Welfare
Deveronvale v Hawick Royal Albert
Banks O’Dee v Huntly
Spartans v Vale of Leithen
Gala Fairydean Rovers v Keith
Lothian Thistle Hutchison Vale v Inverurie Loco Works
BSC Glasgow v Dalbeattie Star
Formartine United v Turriff United
Wick Academy v University of Stirling
Edinburgh University v Lossiemouth
Clachnacuddin v Fort William
Glenafton Athletic v Glasgow University or Threave Rovers
Brora Rangers v Girvan
Ties to be played Saturday, 23 September.