moveto equivalent to drag and drop ?

Please check the FAQ (https://www.xyplorer.com/faq.php) before posting a question...
Post Reply
bossi
Posts: 39
Joined: 30 Jul 2022 11:09

moveto equivalent to drag and drop ?

Post by bossi »

Code: Select all

function move_items_up_menu($lvl)
	{ 
	$paths = sel_files();
	foreach($path,$paths)
		{
		move_item_up($path,$lvl);
		}
	}	

function move_item_up($path,$lvl) // $lvl = -3 =>  1 Level Up
	{ 
	$name = gpc($path, "name");
	$path_n = gpc($path, "component", $lvl, 1);
	moveto $path_n , $path, , 2, 1, 2;
	}
moves items 1 by 1 , 1 item each second

via drag and drop 1000s of files are moved instantly , why is that so ?
and how can i archieve the same via script ?

RalphM
Posts: 1935
Joined: 27 Jan 2005 23:38
Location: Cairns, Australia

Re: moveto equivalent to drag and drop ?

Post by RalphM »

Using a foreach loop does the operations in the loop for one item at a time otherwise you need to look into selectitems and then work with the whole selection in one operation.
Ralph :)
(OS: W11 22H2 Home x64 - XY: Current beta - Office 2019 32-bit - Display: 1920x1080 @ 125%)

bossi
Posts: 39
Joined: 30 Jul 2022 11:09

Re: moveto equivalent to drag and drop ?

Post by bossi »

you're right , will try :)

Post Reply