Code: Select all
::moveto "<curpath>", "<curitem>\*"Thank you.
Code: Select all
::moveto "<curpath>", "<curitem>\*"This is because of the wildcard. The wildcard is passed directly to the shell in this case; therefore the actually moved files are unknown to XY. So XY cannot undo the move.Huidong wrote:Before I tried the following commandin order to move contents of the last selected folder out. It worked, but I noticed that this can not be undone! Why's that?Code: Select all
::moveto "<curpath>", "<curitem>\*"
Thank you.
Merge them all into one folder, hence risking multiple overwrites?Huidong wrote:Thank you, I see why to some extent.
What I want is to move all stuff inside a selected folder (hence <curitem>\*) out of the folder (move up one level), i.e. suck things out of a folder, that's it. To me that's the weakest version of a program called "Suction"
http://mike.geek-republic.com/software/suction/
which does the suction recursively no matter how deep the dir structure is.
Code: Select all
// suction: move all files (recursively) from the folder selected in
// the file list (<curitem>) up to the current folder
$filelist = folderreport("files", "r", <curitem>, "r", , "|");
moveto <curpath>, $filelist;OK, you can try this now with v9.90.0936. (It even can be undone.)admin wrote:OK, got it. In the next beta version you can do this:Code: Select all
// suction: move all files (recursively) from the folder selected in // the file list (<curitem>) up to the current folder $filelist = folderreport("files", "r", <curitem>, "r", , "|"); moveto <curpath>, $filelist;
Code: Select all
C:\FirefoxPortable\App\DefaultData\profile\bookmarks.html
C:\FirefoxPortable\App\DefaultData\profile\chrome\userChrome-example.css
C:\FirefoxPortable\App\DefaultData\profile\chrome\userContent-example.css
C:\FirefoxPortable\App\DefaultData\profile\localstore.rdf
C:\FirefoxPortable\App\DefaultData\profile\mimeTypes.rdf
C:\FirefoxPortable\App\DefaultData\profile\prefs.jsCode: Select all
C:\FirefoxPortable\App\DefaultData\profile\bookmarks.html
C:\FirefoxPortable\App\DefaultData\profile\localstore.rdf
C:\FirefoxPortable\App\DefaultData\profile\mimeTypes.rdf
C:\FirefoxPortable\App\DefaultData\profile\prefs.js
C:\FirefoxPortable\App\DefaultData\profile\chrome\userChrome-example.css
C:\FirefoxPortable\App\DefaultData\profile\chrome\userContent-example.cssEasy (needs v9.90.0936 or later):Huidong wrote:Tried, it worked perfectly for single folder, but I wonder if it's possible to do it for multiple selected folders? I tried <selitems> instead of <curitem> but didn't work.
Code: Select all
// suction: move all files (recursively) from all folders selected in
// the file list up to the current folder
foreach($token, <get selecteditemspathnames |>) {
$filelist = folderreport("files", "r", $token, "r", , "|");
moveto <curpath>, $filelist;
}
Nope.tiago wrote:Don:
Any way to force this to report subfolders contents apart?
$filelist = text folderreport("files", "r", , "r", , "|");
So instead ofI'd haveCode: Select all
C:\FirefoxPortable\App\DefaultData\profile\bookmarks.html C:\FirefoxPortable\App\DefaultData\profile\chrome\userChrome-example.css C:\FirefoxPortable\App\DefaultData\profile\chrome\userContent-example.css C:\FirefoxPortable\App\DefaultData\profile\localstore.rdf C:\FirefoxPortable\App\DefaultData\profile\mimeTypes.rdf C:\FirefoxPortable\App\DefaultData\profile\prefs.jsCode: Select all
C:\FirefoxPortable\App\DefaultData\profile\bookmarks.html C:\FirefoxPortable\App\DefaultData\profile\localstore.rdf C:\FirefoxPortable\App\DefaultData\profile\mimeTypes.rdf C:\FirefoxPortable\App\DefaultData\profile\prefs.js C:\FirefoxPortable\App\DefaultData\profile\chrome\userChrome-example.css C:\FirefoxPortable\App\DefaultData\profile\chrome\userContent-example.css
Perfect! Learning new stuff, powerful stuff; easy for masters, but I never even heard of foreach!admin wrote:Easy:Huidong wrote:Tried, it worked perfectly for single folder, but I wonder if it's possible to do it for multiple selected folders? I tried <selitems> instead of <curitem> but didn't work.Code: Select all
// suction: move all files (recursively) from all folders selected in // the file list up to the current folder foreach($token, <get selecteditemspathnames |>) { $filelist = folderreport("files", "r", $token, "r", , "|"); moveto <curpath>, $filelist; }