A MAN will appear in court today in connection with an incident in Renfrew in which a firearm was discharged at the window of a flat in the town.