Page 1 of 1

moveto equivalent to drag and drop ?

Posted: 05 Nov 2023 05:55
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 ?

Re: moveto equivalent to drag and drop ?

Posted: 05 Nov 2023 06:17
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.

Re: moveto equivalent to drag and drop ?

Posted: 05 Nov 2023 08:05
by bossi
you're right , will try :)