Re: A command to get the list of recently opened files to open them [Solved]
Posted: 16 Mar 2022 15:05
@klownboy Thanks, this is useful. And now I have a working example about how to add icons :-)
Forum for XYplorer Users and Developers
https://www.xyplorer.com/xyfc/
Do you know whether is it possilbe to make this tab to have a correct name (i.e., "Search Results") _before_ the tab has been created?klownboy wrote: ↑16 Mar 2022 00:45Code: Select all
"Recent Locations|:find||1" goto "<get list_recentlocations>? /ln /silent=1";
Code: Select all
"Recent"
tab("new");
goto "<get list_recentlocations>? /ln /silent=1";
sortbylist <get list_recentlyopenedfiles>;
tab("rename", "Search Results");
tab("lock");
Code: Select all
tab("new","I Like Pizza");
Thanks, but how can I switch to the background tab after all preparations are done? This seems to be obvious, but I don't see answer in the Help.
Code: Select all
"test"
tab("newb");
$newbindex = tab("get", "index") + 1;
tab("rename", "Search Results", $newbindex);
// <-- I need to switch to the background tab before using goto -->
goto "<get list_recentlyopenedfiles> ? /silent=1";
seltab?Code: Select all
// to open a tab with recently opened files. the files are sorted in the
// order they were opened (the last opened file will be the topmost)
"recent files"
goto "<get list_recentlyopenedfiles> ? /silent=1";
sortbylist <get list_recentlyopenedfiles>;
// the same for folders
"recent folders"
goto "%SystemDrive% <get list_recentlocations> ? /silent=1 /ln";
sortbylist <get list_recentlocations> /n; // why doesn't it work?
sortbylist <get list_recentlyopenedfiles> works, isn't it?sortbylist <get list_recentlocations> or sortbylist <get list_recentlocations> /n (maybe with ? before /n) will do the same trick for folders. But it doesn't.sortbylist doesn't work with quick search patterns and apart from that, it won't filter by folders with trailing backslashes...He was correct, this line works for me. Here is an example. Create the following 6 files:If you run this scriptsortbylist <get list_recentlyopenedfiles>;[...] I think it is what you are trying to explain you want.
Code: Select all
a1.txt
a2.txt
b1.exe
b2.exe
c1.txt
c2.txt
sortbylist <get list_recentlyopenedfiles>; from the address bar. The order of files will be changed to Code: Select all
c1.txt
a1.txt
a2.txt
b1.exe
b2.exe
c2.txt
Code: Select all
Folder0
|-- Folder1
|-- Folder2
|-- Folder3
sortbylist <get list_recentlocations> or something similar from the address bar. The order of folders should be changed toCode: Select all
Folder0
|-- Folder2
|-- Folder1
|-- Folder3
Code: Select all
<get list_recentlocations>