Latest file link?

Hi

In pursue of my email automation system, I wanted to know, if the link of latest added file to DTPO can be grabbed, without going to DTPO window?

You mean is the link in some cache or clipboard or place easily accessible to a script? No it is not.

I don’t believe DEVONthink publicly records “most recently added” information anywhere – though it could be deduced from a script that tells DEVONthink to import a file, or by brute force with a script that interrogates the database – or by looking at DEVONthink, all of these options are of course the opposite of what you asked.

Hmm. Can I force DTPO to select/highlight the latest added file? I can then trigger a KM macro to do the rest.

You could have Keyboard Maestro call the Tools>History>yourDatabase menu, down arrow to select the first entry (assumes that you have the History window sorted by date added, descending), and then run the rest of your KB macro. You would need a separate macro for each database as I don’t believe that DEVONthink maintains an all databases history list. You could also create a smart group in the Sidebar that would return all documents recently added to all open databases-shouldn’t be too hard to program your KB macro to take it from there.

Thanks Greg_Jones.
Worked as needed.