A simple premise: Drag and drop files from other programs and see them listed in XYplorer!
If only one file is dropped, the script tries to figure out if that file is a filelist itself, and loads that list. Such deep intelligence!
-- -- --
The feature is best used as a CTB or a catalog item. A CTB implementation is given here, as a snippet.
Left-click houses the main droplist script. Right-click displays a menu to show or remove last droplist.
Code: Select all
Snip: CTB 1
XYplorer 18.50.0307, 12/13/2017 5:48:14 PM
Action
NewUserButton
Name
Droplist
Icon
:mrl
ScriptL
// drop a collection of file/folders from any app and see them listed in XYplorer.
$drop = <drop>;
$list = '';
// <drop> is some item(s) dragged from some app
if exists(gettoken($drop, 1, <crlf>)){
$list = $drop;
}
// <drop> is *one* file, may be a filelist
// not elseif; an alternative branch
if (exists($drop)==1) {
// ~line 1 points to a file? assume drop is a file list
if exists(gettoken(readfile($drop,, 2048), 1, <crlf>)) {
if confirm("$drop<crlf>Dropped file may be a filelist. Try to load that list?") {
$list = readfile($drop);
}
}
}
// show $list items with tied paper folder
if $list {
paperfolder("paper:tmp\droplist", $list);
}
ScriptR
"Open last drop list|:autorefresh"
paperfolder("paper:tmp\droplist",,, 'l');
"Forget last drop list|:del"
paperfolder("paper:tmp\droplist",,, 'd');
setting 'backgroundfileops', 0;
delete 0, 0, "<xypaper>\tmp\droplist.txt";
if (property('#empty', "<xypaper>\tmp")==2) {
delete 0, 0, "<xypaper>\tmp";
}
FireClick
0
this uses a paper folder at paper:tmp\droplist.
You can use the Left-click script of that button as a catalog script without any modifications.