Page 1 of 3
Adding QuickAccess (recently edited files)
Posted: 30 Nov 2016 06:24
by ThadiusIII
XYplorer is looking great, but I haven't been able to fully replicate the Win 10 File Explorer "Quick Access" functionality (see attachment). I understand I can use a few XYplorer mechanisms to save favorite folder paths etc., but the functionality I'm missing is the list of recently used folders and recent files. I've tried using a "finding tab" to return files modified in the past 24 hours, but that seems to perform too slowly and returns false positives (e.g. files updated by the system). Any suggestions?
Re: Adding QuickAccess (recently edited files)
Posted: 30 Nov 2016 09:22
by highend
Two ways:
1. Just drag the folder "C:\Users\%USERNAME%\AppData\Roaming\Microsoft\Windows\Recent"
onto the "Links" icon in the tree (Configuration | Tree and List | Items in Tree and List | Show Links folder must be checked)
2. Or a "more sophisticated" way by writing a script that filters that folder for unnecessary entries (everything that is not
a file or folder) which could be invoked e.g. by a hotkey and presents a (filterable) list from which you could choose...
Something like this:
Code: Select all
$limitFileEntries = 0;
$exclude = <<<>>>
desktop.ini
library-ms
>>>;
$exclude = regexreplace(formatlist($exclude, "t", <crlf>), "^(.)", "*$1");
$recentItems = listfolder("%APPDATA%\Microsoft\Windows\Recent", , 1, <crlf>);
$pattern = regexreplace($exclude, "(#|\[)", "[$1]");
$recentItems = formatlist($recentItems, "f", <crlf>, "!$pattern", "f");
$countItems = gettoken($recentItems, "count", <crlf>);
if !($recentItems) { status "No recent files or folders found, aborted!", "8B4513", "stop"; end 1==1; }
$max = ($limitFileEntries < $countItems) ? (($limitFileEntries) ? $limitFileEntries : $countItems) : $countItems;
$files = "";
$folders = "";
while ($i++ < $max) {
$realPath = property("#LinkTarget", gettoken($recentItems, $i, <crlf>));
if (exists($realPath) == 2) { $folders = $folders . $realPath . <crlf>; }
elseif (exists($realPath) == 1) { $files = $files . $realPath . <crlf>; }
}
$dst = inputselect("Go to / open recent folder / file", formatlist($folders . <crlf> . $files, "e", <crlf>), <crlf>, 5);
if (exists($dst) == 2) { goto $dst; }
else { open $dst, "w"; }
Moved the topic to "Tips & Tricks, Questions & Answers"
Re: Adding QuickAccess (recently edited files)
Posted: 30 Nov 2016 16:36
by klownboy
Hi highend, I hope you're doing well. That script could be very useful. I may try to modify it slightly to only display the last 10 (or whatever number) files accessed by date as opposed to alphabetical order of all of them. The next step might be to combine it with one of the recent folder menus in the Clean Recent script thread
viewtopic.php?f=7&t=11458 such that we end up having a nice menu listing of recent files and recent folders.
Take care,
Ken
Re: Adding QuickAccess (recently edited files)
Posted: 30 Nov 2016 17:30
by highend
Everything's all right
Only three changes are necessary to get the a list sorted after last used date
Code: Select all
$limitFileEntries = 0;
$exclude = <<<>>>
desktop.ini
library-ms
>>>;
$exclude = regexreplace(formatlist($exclude, "t", <crlf>), "^(.)", "*$1");
$recentItems = folderreport("items:{modified yyyymmddhhnnss}|{fullname}", "r", "%APPDATA%\Microsoft\Windows\Recent", , "r", <crlf>);
$pattern = regexreplace($exclude, "(#|\[)", "[$1]");
$recentItems = formatlist(formatlist($recentItems, "r", <crlf>), "f", <crlf>, "!$pattern", "f");
$countItems = gettoken($recentItems, "count", <crlf>);
if !($recentItems) { status "No recent files or folders found, aborted!", "8B4513", "stop"; end 1==1; }
$max = ($limitFileEntries < $countItems) ? (($limitFileEntries) ? $limitFileEntries : $countItems) : $countItems;
$files = "";
$folders = "";
while ($i++ < $max) {
$realPath = property("#LinkTarget", gettoken(gettoken($recentItems, $i, <crlf>), 2, "|"));
if (exists($realPath) == 2) { $folders = $folders . $realPath . <crlf>; }
elseif (exists($realPath) == 1) { $files = $files . $realPath . <crlf>; }
}
$dst = inputselect("Go to / open recent folder / file", formatlist($folders . <crlf> . $files, "e", <crlf>), <crlf>, 5);
if (exists($dst) == 2) { goto $dst; }
else { open $dst, "w"; }
Re: Adding QuickAccess (recently edited files)
Posted: 30 Nov 2016 19:20
by klownboy
Thanks highend, that was quick...while I was still only thinking about it.
By the way, do know the logic as to when Windows updates that list in ...Recent? I ask because unlike XY's recent folders/locations, it doesn't have the latest folders accessed/opened via XYplorer.
Re: Adding QuickAccess (recently edited files)
Posted: 27 Aug 2018 16:21
by babelmansour
Hello,
thanks much for the script which works well. As i am a new XYplorer user, I would like to know how to create a permanent link or tab listing the recently edited folders/files.
Thanks again
Re: Adding QuickAccess (recently edited files)
Posted: 27 Aug 2018 16:40
by highend
You could just open a tab and open the recent location in it (and save your settings afterwards). There is no "autoupdate" without displaying the folder contents itself, everything else requires the script...
Re: Adding QuickAccess (recently edited files)
Posted: 17 May 2020 17:22
by DaiKen
Wonderful piece of code, but what to do after running it? I can select something from the code's output window, but that's it.
recentxy.png
Can't this output be connected to a tab?
Hope to hear from you!
Re: Adding QuickAccess (recently edited files)
Posted: 17 May 2020 17:38
by highend
You could load it as a paperfolder instead...
Re: Adding QuickAccess (recently edited files)
Posted: 19 May 2020 19:45
by DaiKen
Thanks for your quick reply, highend. You mean 1) I can load the script as a paper folder, or 2) load C:\Users\name\AppData\Roaming\Microsoft\Windows\Recent as a paper folder?
2 I did, but am curious is 1 is possible.
Re: Adding QuickAccess (recently edited files)
Posted: 19 May 2020 20:14
by highend
Replace these
Code: Select all
$dst = inputselect("Go to / open recent folder / file", formatlist($folders . <crlf> . $files, "e", <crlf>), <crlf>, 5);
if (exists($dst) == 2) { goto $dst; }
else { open $dst, "w"; }
with
Code: Select all
$folders = formatlist($folders, "sed", <crlf>);
$files = formatlist($files, "sed", <crlf>);
if ($folders || $files) { paperfolder("Recent items", $folders . <crlf> . $files); }
Re: Adding QuickAccess (recently edited files)
Posted: 21 May 2020 10:36
by DaiKen
Thanks again for your reply.
I am not new to IT and/or programming (my first lines of code stem from 1972 ;-)), but xyplorer scripting is new to me, and I didn't have had the time yet to dive into it.
Your latest suggestion 1) does work, but 2) hasn't the effect desired by me, alas. I see the same as before after running the code (which takes a while btw)
xyplorerRecent2.jpg
What am I doing wrong?
Re: Adding QuickAccess (recently edited files)
Posted: 21 May 2020 10:42
by highend
Don't know as long you're not posting the full script you're using now but it's rather obvious that you still have the lines in it, otherwise you wouldn't get a window with the "Go to / open recent folder / file" title
Re: Adding QuickAccess (recently edited files)
Posted: 21 May 2020 16:43
by DaiKen
You are absolutely RIGHT! I made a copy of the original file, changed the lines, but forgot to update my Commands...
It's looking great now:
xyplorerRecent3.jpg
Time to unlock the trial version, buy you a beer or a coffee and get into scripting myself, ThnX!
Re: Adding QuickAccess (recently edited files)
Posted: 21 May 2020 18:53
by highend
A modernized version:
Show recent items [paperfolder]_v0.3.xys
- Correct deduplication of entries
- Skip network paths if shift key is hold when the script is executed (may not work from the catalog)
- Open in a new tab instead of the current one
- Automatic sort by last modified date
Regarding the slowness of the script:
Normally caused by non existing / non reachable items, mostly UNC paths.
Hence the option to include them only with the shift key pressed.
buy you a beer
My paypal address is in my signature
