Page 1 of 2

A command to get the list of recently opened files to open them [Solved]

Posted: 13 Mar 2022 10:26
by John_C
I search for a command to get the list of recently opened files so that I can open any of them. That is, something similar to #539, but for files, not directories. Does it exist?

( I know there is the command #632, but it works differently. )

Re: A command to get the list of recently opened files to open them

Posted: 13 Mar 2022 10:43
by highend
No, there isn't.

Save your config as a temp one, getsectionlist of "mruOpenedItems" and you have it...

Re: A command to get the list of recently opened files to open them

Posted: 13 Mar 2022 11:03
by John_C
Thanks. Still not possible to open them, though...

Re: A command to get the list of recently opened files to open them

Posted: 13 Mar 2022 11:33
by klownboy
You may want to check on these scripts here viewtopic.php?p=183087#p183087. It will give you the option of opening, go to, or go to and run recent files.

Re: A command to get the list of recently opened files to open them

Posted: 13 Mar 2022 12:27
by John_C
Thanks a lot, I will try it today.

Re: A command to get the list of recently opened files to open them

Posted: 13 Mar 2022 20:52
by jupe

Re: A command to get the list of recently opened files to open them

Posted: 13 Mar 2022 23:33
by John_C
jupe, this is really brilliant.

I have tried to replace list_recentlyopenedfiles with list_recentlocations to have the same tab for directories, but it works weird.

The first issue is that it doesn't work if I run it being in a "special" tab such as Computer or Recycle Bin.

The second issue is worse. It seems that <get list_recentlocations>?/silent=1 lists literally everything. ALL directories and ALL files. It have found 100,000 files before I stopped it, including files that I have never opened like 4bvdhvdh36t73e.xml somewhere deep in Program Files.

What's wrong with it? :)

Re: A command to get the list of recently opened files to open them

Posted: 13 Mar 2022 23:35
by jupe
There is nothing wrong with it, you are the problem. I never suggested to use recentlocations, you are doing a recursive search of all the contents of those locations doing that, you'd need to achieve this differently, eg.
<get list_recentlocations>?/silent=1 /ln

Correct it won't work on a special tab, create a new tab to run it, or script its invocation.

Re: A command to get the list of recently opened files to open them

Posted: 14 Mar 2022 00:04
by John_C
This is even better than I expected in the first post. (This lists both recent files and recent folders, while I've expected only folders.) Thanks a lot, jupe!

Re: A command to get the list of recently opened files to open them [Solved]

Posted: 14 Mar 2022 00:36
by John_C
I see you use two switches, l and n. Where I can read about them and about other switches that can be used with this command?

Actually, <get list_recentlocations>?/silent=1 /ln worked somewhat strange for me. It have listed both files and directories (a bug? anyway, I liked it), but each file and each directory were listed twice (what the heck?). After I cleared the list of recent locations, it doesn't list items duplicated (OK, fine), but now it also doesn't list files (pity).

I want try to understand what is going on.

Re: A command to get the list of recently opened files to open them [Solved]

Posted: 14 Mar 2022 00:42
by jupe
quicksearch switches are in the main help under Quicksearch, to make it robust/reliable you would probz need to script it rather than the 1-liner AB example, I was originally just using the addressbar input as a quick way of demonstrating what is possible, it is up to you to adapt the cmds as required, such as a script which combines the 2 recent lists removes duplicates etc. before display in a tab.

But if you still want both combined by just using 1-liner AB input (which may contain virtual/special/real path duplicates, as you mentioned), then eg.
<get list_recentlocations><crlf><get list_recentlyopenedfiles>?/silent=1 /ln

BTW going back to orig question, you can also open recent files from File | Open dialog.

Re: A command to get the list of recently opened files to open them

Posted: 14 Mar 2022 11:08
by admin
jupe wrote: 13 Mar 2022 20:52 viewtopic.php?p=182111#p182111
The next beta will keep a soft term like <get list_recentlyopenedfiles>?/silent=1 //Recently Opened Files unchanged across tab switches and sessions. Currently it is handed down in its resolved form which can be thousands of characters long.

Re: A command to get the list of recently opened files to open them [Solved]

Posted: 15 Mar 2022 09:39
by John_C
Thanks, Dan!

Jupe, could you explain why these things work so strange?

I have created a catalog entry "Recents", which loads recents.xys. The current contents of recents.xys is following:

Code: Select all

"Recents"
  %SystemDrive%
  <get list_recentlocations>
  <get list_recentlyopenedfiles>?/silent=1 /ln
This works, now the search of recent locations and recently opened files can be started from any tab.

But if I change the second line from %SystemDrive% to tab("new", "C:\");, the whole script stops working. On the other hand, tab("new", "C:\"); on its own works fine.

Re: A command to get the list of recently opened files to open them [Solved]

Posted: 15 Mar 2022 16:43
by jupe
What you posted isn't a script, it is just shorthand for quickly going to locations (and it still isn't that correctly, because you mixed in get vars without parsing or a script cmd to launch them), to get it to be parsed as a script the whole things needs to be scripting commands on every-line, not just paths mixed with scripting commands & vars.

Re: A command to get the list of recently opened files to open them [Solved]

Posted: 16 Mar 2022 00:45
by klownboy
Hi John_C, there are so many ways of doing something similar, but here's one. I added the second main menu item only so there was more than one main menu item. Try the last submenu under "Recents". It will open the recent JPGs and GiFs in a new instance... just for jollies. This must be saved as a script file (e.g., recents.xys).

Code: Select all

"Recents|:favs"
"System Drive|:drives||1" goto "%SystemDrive%";
"Recent Locations|:find||1" goto "<get list_recentlocations>? /ln /silent=1";
"HotList|:find||1" #530;
"Recent Locations Inputselect|:find||1" open inputselect("Recent Locations", get("list_recentlocations"), <crlf>, 1+4+8192 ); 
"Recent Files|:favfiles||1" goto "<get list_recentlyopenedfiles>?/silent=1";
"Recent - JPGs && GIFs|:favfiles||1"
   $self = self("file");
   run """<xy>"" /new /win=normal,650,250,350,900 /script=""::load '$self','_Auto'""", , 0,0;
"_Auto";
   setlayout("ShowNav=0,ShowTabs=0,ShowCatalog=0,ShowStatusbar=0,ShowCrumb=0,ShowAddressbar=0,ShowToolbar=0,ShowMainMenu=0");
   dark 1;
   goto "<get list_recentlyopenedfiles>?/silent=1 /types=gif;jpg";

"Tools && Utilities|:conf"
"Device Manager|:openwith||1" run "explorer shell:::{74246bfc-4c96-11d0-abef-0020af6b0b7a}";
"IP Configuration|:mru||1" text runret ("cmd /c ipconfig /all"), 720, 900, "IP Config",,;
"Disk Management|:cfi||1" open "C:\Windows\System32\diskmgmt.msc";
EDIT: Removed the line that used AHK to disable the title bar inadvertently left in.