Get yourself a reed-switch...the kind that has a "paddle" on it.
Mount it in such a way that when you throw the bar through the track (w/wo the padlock) the "paddle" is depressed and it will then make/break the circuit you have feeding power to the opener-motor.
Simple and sweet.
Get a reed-switch for the rated power/current you expect to encounter with your project. To be on the safe/durable side, get the next up-rated unit...it will last longer.
A simple note: It's always best to run "low-voltage" down low where there's a chance some little "kidlette" might be goofing around...remote the AC up high and out of sight and your home-owners' insurance agent won't get all sorts of hinky on you (or your work) should something happen. Insulated terminals/spade-lugs and wiring will go along way to making everyone happy and fat like a pig.
Enjoy!