checking if a file is open?

Is there any way to check if a file is open with apple script?

Basically i have a program that launches the file (in whatever it’s default program is) and starts a timer. When the file is closed I want the timer to stop. The program isn’t written in Applescript but if there is a way to do this in applescript it would be helpful?

Thanks for any help,
Tom

Jon’s Additions has a FileIsBusy command.

http://www.osaxen.com/commands/740.html

Rob gives a good example of using Standard Additions and File Info to find out if a file is busy in this thread:

http://bbs.applescript.net/viewtopic.php?t=8065&highlight=busy

Pay attention to the solution that Rob gives as it is a good formula for your situation.