How to clear only invalid entries in Recent Files
Submitted by Wednesday, 22 October, 2008 - 18:26
on
Hi all,
I was wondering if there was a way for a macro to go through the items in Recent files list and delete invalid entries, leaving the rest. My Java know-how is not very extensive, and after some googling and searching the default macros code, I have put together a few lines of code which luckily do not throw an exception, but unfortunately do not apply the desired changes to Recent Files menu.
I would be grateful for any help.
  Cheers, tvojeho.
 Â
BufferHistory.Entry[] recentBuffersArray = BufferHistory.getHistory().toArray(new BufferHistory.Entry[0]); // get history
for(i=0;i recentPath = recentBuffersArray[i].path; if( ! new File(recentPath).exists()) { BufferHistory.Entry removeEntry(recentPath); } } return;