Andrew McIntyre has been jailed for two-and-a-half years over the attack, which took place on September 18 last year in Glenrothes, and a string of other offences.
McIntyre first fired the weapon at Donna Acomb in the Fife town’s Alexander Road at around 9pm that night - an hour before polls closed in the historic vote.
Kirkcaldy Sheriff Court heard that the incident appeared to have been brought about by the music blaring from Miss Acomb’s flat.
Miss Acomb was hit with one pellet, and another smashed her TV.
The court heard McIntyre “repeatedly discharged” the air gun into the flat.
The charge admitted by McIntyre states the attack “caused danger to Donna Acomb and the lieges”.
CONNECT WITH THE SCOTSMAN
• Subscribe to our daily newsletter (requires registration) and get the latest news, sport and business headlines delivered to your inbox every morning
Fiscal depute Cheryl Clark said: “The complainer opened her balcony doors and began playing loud Scottish music which could be heard on the street.
“The shots were discharged and the complainer was heard to shout ‘What have you done - you’ve smashed my telly’.
“She was also hit on the forearm and suffered swelling.”
McIntyre, 34, a prisoner at HMP Perth, pleaded guilty on indictment to charges of assault and culpably and recklessly discharging an air rifle.
McIntyre was on three separate bail orders at the time of the attack.
He further admitted a series of road traffic offences and an offence under the Police and Fire Reform Act.
Defence solicitor Iain McCafferty said McIntyre knew he was facing a lengthy jail term.
Sheriff Alastair Thornton jailed McIntyre for 18 months for the air rifle attack, two months for the police assault and a total of 10 months on the road traffic offences.
SCOTSMAN TABLET AND IPHONE APPS