Will a script do this?

I want something to run in the background on my Mac that will track every file and application I open and close. I want it to write to a file the name of the app, when started and quit, the names of each file, when opened and closed.

Should I forget about a script for this? Should I just plan to write something in RB or whatever to accomplish this?

Any and all advice appreciated.

A simple approach would be to create a script that would open and close apps. You would essentially use it as your “Finder”. Then the app wouldn’t have to run in the background. Here’s a quick scheme:


set the_file to (choose file)
set FName to name of (info for the_file) as string
set FileOpenTime to current date
tell application "Finder" to open the_file
display dialog FName & return & FileOpenTime

That opens files/ applications, stamps the date it happens, and here displays it to you. You can easily write Fname and FileOpenTime to a log that you can keep going, ie append.
So that’s half of it. Instead of running in the background, the script would quit.
How would you log the quits and closing of files? Get back if this appeals…
SC