Recent files by type

LiveCode is the premier environment for creating multi-platform solutions for all major operating systems - Windows, Mac OS X, Linux, the Web, Server environments and Mobile platforms. Brand new to LiveCode? Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
acidjazz
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 93
Joined: Mon Feb 16, 2009 2:37 am

Recent files by type

Post by acidjazz » Fri Aug 28, 2009 4:16 am

Hi all,

I want to create a program that keeps track of which applications I open during the day (e.g., Word, Excel, Chrome, RunRev, iTunes, etc.), the number of minutes each application was open, and possibly how many different files were opened by that application. I use Vista, and realize that the "Recent" folder effectively tells me this. However, I have been frustrated at not being able to sort items in that folder by type (it only stores shortcuts). Plus, I think it would be nice to see screen shots of each program in action. I assume that I will need to use some shell commands, but I know anything about those really. Any suggestions?

- Mark

ADDENDUM: One approach might be to tap into whatever textfile (I assume its a textfile) each application uses to remember the most recent files it has opened. That wouldn't give me the amount of time used, but just having a page with links to 10 or 15 most recent files for EACH of the applications I use daily (all in one location) would be a huge step in the right direction. Of course, I don't know what files each program uses to store this info ... Does anyone?

Klaus
Posts: 14198
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Post by Klaus » Fri Aug 28, 2009 8:24 am

Hi Mark,

sorry, the only hint I can give in this case is about "shortcuts".

Check the "aliasReference()" function in the docs (Revolution Dictionary), it will resolve the shortcuts to the actual path of the file it points to.

Maybe that gets you started.


Best

Klaus

SparkOut
Posts: 2947
Joined: Sun Sep 23, 2007 4:58 pm

Post by SparkOut » Fri Aug 28, 2009 10:19 am

You might find it worth examining the registry, which will hold a lot of information about the MRU lists for different file types. If you poll the registry keys and check whether things change you might be able to parse what's new and track accordingly.

HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\RecentDocs is the key to look at (at least on WinXP here) and it holds binary data, so you will have to do some decoding to be able to parse results.

As well as that key which holds the "big picture list" there are subkeys for all file extension types below, so you can see the MRU list just for all the .doc or .rev files, for example. These will be a REG_BINARY numeric key, with value data in binary from which you can extract the .lnk information.
The MRUListEx key holds the list order of the items keyed, so if that changes you know that the most recently used file has changed, you can then see which one it was by checking the first item in that key data, and then looking up the key that corresponds to.

HTH

acidjazz
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 93
Joined: Mon Feb 16, 2009 2:37 am

Post by acidjazz » Sat Aug 29, 2009 3:24 am

Thanks Klaus and SparkOut. Binary is a bit beyond me at the moment, so I'll start with the aliasReference() function. That sounds exactly like what I was looking for. Then I can organize file names according to the extension which gets me most of what I was asking for. Thanks very much.

Mark

Post Reply