To sort files in the order they were opened [Solved]

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

To sort files in the order they were opened [Solved]

Post by John_C »

Is it possible to sort files in the order you have opened them?

This is useful, for example, when you view a tab that lists all of the files you have recently opened:

Code: Select all

<get list_recentlyopenedfiles> ? /silent=1
The column "Accessed" cannot be used for this.
Last edited by John_C on 25 Mar 2022 22:35, edited 2 times in total.

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

Re: To sort files in the order they were opened

Post by jupe »

Short answer is no, as you know the best you can do currently is have them displayed in the order they are in in the recently opened list.

You could possibly write a script that all files are associated with via CFA so that every time you run one it adds a date and filename to a log before opening the file, and then process that file when you open your recent list, but it would be quite a bit of scripting.

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

Re: To sort files in the order they were opened

Post by John_C »

I see, thanks.

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

Re: To sort files in the order they were opened [Answered]

Post by highend »

Are "list_recentlyopenedfiles" files in any other way populated than through "File - Open"?
Double clicking them inside XY doesn't seem to add them to that list...
One of my scripts helped you out? Please donate via Paypal

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

Re: To sort files in the order they were opened [Answered]

Post by John_C »

This looks interesting.

When I open a file by double clicking or by pressing Enter, XY do add the file to that list...

xy 20.30, win7

the same for xy 20.90.0100
Last edited by John_C on 25 Mar 2022 21:11, edited 2 times in total.

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

Re: To sort files in the order they were opened [Answered]

Post by jupe »

@highend: no they get added when your CFA is eg ext>exe or via SC open etc or plain OS assoc too in most cases, but not other SC CFAs like run.

@John_C: I just had a thought, maybe you are asking this question because you have saved your QS results screen to sort by name by default or something, in that case then you will get that sort, but if you are happy with the order that is in List Management, which mainly gets updated when a file is re-launched anyway, then if you change your sort to "Unsorted" it shows them in that order, I think I misunderstood your question.

View | Sort By | Unsorted

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

Re: To sort files in the order they were opened [Answered]

Post by John_C »

Hmm, no View | Sort By| Unsorted doesn't change the order the files are sorted.

Neither refreshing the tab changes anything.

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

Re: To sort files in the order they were opened [Answered]

Post by jupe »

It wouldn't change the order unless you had already sorted by a different column first (maybe by your defaults), which I thought you might have done otherwise why would you be asking because they already display in the recent list order then.

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

Re: To sort files in the order they were opened [Answered]

Post by John_C »

Well, yes, this is something obvious, but what I need is to sort the files as they were opened.

I have created six files:

Code: Select all

a1.txt
a2.txt
b1.exe
b2.exe
c1.txt
c2.txt
They are sorted by name here.

If I resort them by extension, it will be

Code: Select all

b1.exe
b2.exe
a1.txt
a2.txt
c1.txt
c2.txt
If I change the order to Unsorted, the order will stay the same.

If I open c1.txt with Sublime Text and then close it, the order will stay the same.

If I change the sorting back to "by name", the order will be as in the first example.

But since I have opened c1.txt, I expect to have

Code: Select all

c1.txt
a1.txt
a2.txt
b1.exe
b2.exe
c2.txt
or

Code: Select all

c1.txt
b1.exe
b2.exe
a1.txt
a2.txt
c2.txt
at some point.

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

Re: To sort files in the order they were opened [Answered]

Post by highend »

Mh, it must work differently here...

A fresh 22.30 instance shows 155 folders and 916 files when
<get list_recentlyopenedfiles> ? /silent=1
is executed from the address bar

I've never opened 99% of them at all (neither in the fresh instance^^ nor in my normal configured one)

What am I missing here?
One of my scripts helped you out? Please donate via Paypal

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

Re: To sort files in the order they were opened [Answered]

Post by jupe »

If you run this script sortbylist <get list_recentlyopenedfiles>; with the recent list tab visible, I think it is what you are trying to explain you want.

@highend: If the list is empty (eg. fresh, check list management) you will get a recursive search of the folder that is open, since the var will be ""

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

Re: To sort files in the order they were opened [Answered]

Post by highend »

If the list is empty (eg. fresh, check list management) you will get a recursive search of the folder that is open.
Ah :tup:

Not really what I would have expected :)
One of my scripts helped you out? Please donate via Paypal

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

Re: To sort files in the order they were opened [Answered]

Post by highend »

Yeah, I see, the result will be "correct" when used via text get("list_recentlyopenedfiles");
Either empty or the opened files...
One of my scripts helped you out? Please donate via Paypal

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

Re: To sort files in the order they were opened [Answered]

Post by John_C »

If you run this script sortbylist <get list_recentlyopenedfiles>; with the recent list tab visible, I think it is what you are trying to explain you want.
Yes, it seems this is exactly what I asked for, thanks!

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

Re: To sort files in the order they were opened [Solved]

Post by jupe »

@John_C: :tup:

@highend: When the var is empty it's the same behavior as entering this in the AB ? /silent=1.

Post Reply