newbie: periodically checking document open status?

Hi all, totally new to scripting of any kind…
I am wondering if it’s possible to periodically (say every ten minutes) check what documents from inside a particular folder (say user/documents/work) are open?
I’m looking to write something that can log how much time is spent working on various documents in various different applications.

keen to learn!
thanks

Not directly. There’s no way to tell by looking at a file whether it’s open or not.

The easiest way to go about this is to approach if from the opposite direction - that is, query each application to find our what documents it has open. However, due to variations in each application’s dictionary you’ll need to write a custom handler for each application that you want to check, but that could be a lot of work and would only cover the apps you expect/plan for.