Flash IDE as a part of a build process

Hello,

Does anybody use Flash IDE for building their fla files withing an ant (or maven) script?
I faced a problem, that if Flash IDE is already opened, then calling flash.exe from ant just activates Flash IDE instance and proceeds to the next step without waiting for swf to get published.