I think NSURL's NSURLContentAccessDateKey may be close to what you are after and may help depending on what you are actually doing..
But it is accessed not opened.
Which means for example:
if you open the file it is accessed.
If you quicklook the file it is accessed.
NSURLContentAccessDateKey The time at which the resource was most
recently accessed, returned as an NSDate object if the volume supports
access dates, or nil if access dates are unsupported (read-only).
Available in OS X v10.6 and later. Declared in NSURL.h.
Example:
- (void)applicationDidFinishLaunching:(NSNotification *)aNotification
{
[self lastAcccess:@"/Users/UserName/Pictures/screenshots/text.png"];
}
- (void) lastAcccess: (NSString *) the_path {
NSURL *theUrl = [NSURL fileURLWithPath:the_path];
NSError * error;
NSDate *theDate;
[theUrl getResourceValue:&theDate forKey:NSURLContentAccessDateKey error:&error];
NSLog(@" theDate %@", theDate);
}