Well flies are usually in the house before they see there's basil on the windowsill, I'm not sure they recognise it from outside, lol! It's said pennyroyal repels them too...but not so. I don't think there are any magical solutions. Far more flies come through an open door than an open window so if you have doors open maria you could try a net or bead curtain (but they get on my nerves).
I bought some fly spray from them.. and it works really well! You spray it on your windows and they touch the window and drop dead.. Its quite toxic I think.. and you dont need much!