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

Please check the FAQ (https://www.xyplorer.com/faq.php) before posting a question...
John_C
Posts: 336
Joined: 16 May 2018 20:04

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

Post 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. )
Last edited by John_C on 14 Mar 2022 00:05, edited 1 time in total.

highend
Posts: 14571
Joined: 06 Feb 2011 00:33
Location: Win Server 2022 @100%

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

Post by highend »

No, there isn't.

Save your config as a temp one, getsectionlist of "mruOpenedItems" and you have it...
One of my scripts helped you out? Please donate via Paypal

John_C
Posts: 336
Joined: 16 May 2018 20:04

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

Post by John_C »

Thanks. Still not possible to open them, though...

klownboy
Posts: 4397
Joined: 28 Feb 2012 19:27
Location: Windows 11, 25H2 Build 26200.7171 at 100% 2560x1440

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

Post 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.

John_C
Posts: 336
Joined: 16 May 2018 20:04

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

Post by John_C »

Thanks a lot, I will try it today.

jupe
Posts: 3292
Joined: 20 Oct 2017 21:14
Location: Win10 22H2 120dpi

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

Post by jupe »


John_C
Posts: 336
Joined: 16 May 2018 20:04

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

Post 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? :)

jupe
Posts: 3292
Joined: 20 Oct 2017 21:14
Location: Win10 22H2 120dpi

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

Post 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.

John_C
Posts: 336
Joined: 16 May 2018 20:04

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

Post 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!

John_C
Posts: 336
Joined: 16 May 2018 20:04

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

Post 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.

jupe
Posts: 3292
Joined: 20 Oct 2017 21:14
Location: Win10 22H2 120dpi

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

Post 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.

admin
Site Admin
Posts: 64916
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

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

Post 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.

John_C
Posts: 336
Joined: 16 May 2018 20:04

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

Post 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.

jupe
Posts: 3292
Joined: 20 Oct 2017 21:14
Location: Win10 22H2 120dpi

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

Post 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.

klownboy
Posts: 4397
Joined: 28 Feb 2012 19:27
Location: Windows 11, 25H2 Build 26200.7171 at 100% 2560x1440

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

Post 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.
Last edited by klownboy on 16 Mar 2022 15:52, edited 1 time in total.

Post Reply