Command Worked before now not!!!

Please check the FAQ (https://www.xyplorer.com/faq.php) before posting a question...
Post Reply
Formingus
Posts: 28
Joined: 14 Jan 2009 11:44

Command Worked before now not!!!

Post by Formingus »

I Use this command to create directory and move a selected file created directory with name file name....
ex: File work.rar, will moved into directory name called WORK
Select then Move to Selected Named Folder
/*
Copy Name of Selected File OR Folder
Create new Folder with copied Name
Move that file OR FOLDER in that folder
While position will remain on root
*/
end( get("CountSelected") > 1 , Select one item only);
//GET Name of Selected File Folder
$ITEM = "<curitem>";
$NAME = "<curname>";
if(exists($ITEM)==2){
$FOLDER = $ITEM;
$FldTemp = $FOLDER . "_xyTEMPxy";
//Create new Folder with copied Name
new $FldTemp, dir;
//Move that file in that folder
//While position will remain on root
moveto $FldTemp, $FOLDER; wait 1000;
renameitem($NAME,$FldTemp);
}else{
$FILE = $ITEM;
$BASE = report("{BaseName}",1);
//Create new Folder with copied Name
if(exists("<curpath>\$BASE")!=2){new $BASE, dir;}
//Move that file in that folder
//While position will remain on root
moveto $BASE, $FILE;
}

For Newer Version

end(get("CountSelected") != 1, "You have to select only ONE item!");
$curItem = "<curitem>";
if not (exists("<curpath>\<curbase>") == 2) { new("<curpath>\<curbase>", "dir"); }
moveto "<curpath>\<curbase>", $curItem;
This script not work on last version, where is the problem ?

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

Re: Command Worked before now not!!!

Post by highend »

It works fine, I guess you didn't indent the lines correctly...

Btw, this one does exactly the same:

Code: Select all

end(get("CountSelected") != 1, "You have to select only ONE file!");
    moveto "<curpath>\<curbase>", <curitem>, , 2, 2;
One of my scripts helped you out? Please donate via Paypal

Formingus
Posts: 28
Joined: 14 Jan 2009 11:44

Re: Command Worked before now not!!!

Post by Formingus »

Before i used wholle code, now i used only this one

end(get("CountSelected") != 1, "You have to select only ONE file!");
moveto "<curpath>\<curbase>", <curitem>, , 2, 2; and worked fine, thanks

Post Reply