[Funcion] Folder.Move

Todas los scripts relacionados con AMS.
Buenas amigos de amsspecialist.info, hoy mirando en el foro de ru-board he visto un script que me a parecido interesante la verdad es que no lo he probado pero a simple vista parece qye funciona correctamente espero que os guste y os sea de gran utilidad.
function Folder.Move(sInFolderPath, sDestFolderPath)
    sInFolderPath = String.TrimRight(sInFolderPath, "\\");
    sDestFolderPath = String.TrimRight(sDestFolderPath, "\\").."\\"..String.Mid(sInFolderPath, String.ReverseFind(sInFolderPath, "\\", false) + 1, -1);
    if not Folder.DoesExist(sDestFolderPath) then
        Folder.Create(sDestFolderPath);
    end
    File.Move(sInFolderPath.."\\*.*", sDestFolderPath, true, true, false, true, nil);
    -- Test for error
    error = Application.GetLastError();
    if (error ~= 0) then
        Dialog.Message("Error", _tblErrorMessages[error], MB_OK, MB_ICONEXCLAMATION);
    else
        Folder.Delete(sInFolderPath);
    end
end
--************************
local sDir = Dialog.FolderBrowse("Please select a folder:", "AutoPlay\\Docs");
if sDir ~= "CANCEL" then
    Folder.Move('C:\\Downloads', sDir);
end
Hola Ceone XD

Te he perfeccionado un poquito el script ya que le farta el progress:

function Folder.Move(sInFolderPath, sDestFolderPath)

	
    
    StatusDlg.Show();
	StatusDlg.ShowCancelButton(true, "Cancelar el movimiento");
	StatusDlg.SetMeterRange(0, "100");-- finish limit at 100 %
	actual = StatusDlg.GetMeterPos();--detect current pos
	StatusDlg.SetMeterPos(actual);
	nPercentage = Math.Floor(actual / 100);
	StatusDlg.SetTitle("Moviendo al (" .. nPercentage .. "%)...");
	
	
    sInFolderPath = String.TrimRight(sInFolderPath, "\\");
    sDestFolderPath = String.TrimRight(sDestFolderPath, "\\").."\\"..String.Mid(sInFolderPath, String.ReverseFind(sInFolderPath, "\\", false) + 1, -1);
    if not Folder.DoesExist(sDestFolderPath) then
        Folder.Create(sDestFolderPath);
    end
    File.Move(sInFolderPath.."\\*.*", sDestFolderPath, true, true, false, true, nil);
    -- Test for error
    error = Application.GetLastError();
    if (error ~= 0) then
        Dialog.Message("Error", _tblErrorMessages[error], MB_OK, MB_ICONEXCLAMATION);
    else
	    Folder.DeleteTree(sInFolderPath, nil);

    end
    
    
    if StatusDlg.IsCancelled() then-- si se cancela se corta la operacion
		StatusDlg.Hide();
		return false;
	else
		if nCopBytes == nTotBytes then
			StatusDlg.SetStatusText("Terminado!");
			Application.Sleep(1000);
			StatusDlg.Hide();
			return false;
		else
			return true;
		end
	end
end
--************************
local sDir = Dialog.FolderBrowse("Please select a folder:", "AutoPlay\\Docs");--ELIGE UNA RUTA
if sDir ~= "CANCEL" then
    Folder.Move('C:\\TUCARPETA', sDir);--CAMBIA TU CARPETA POR LA QUE QUIERAS MOVER
end




esta bien pero abria sido mejor crear un callback que meter el status ay del palazo... :D pero bueno todo sea por mejorar!
tal vez podria haber creado una minifuncion para el status pero weno con esto funciona bien XD ademas quedaba feo sin saber si estaba moviendose o no asi que te lo he puesto XD como dice el lechu haciendo un poco el tocacoj XDDD
bueno la cuestión es ir haciendo... y aprendiendo mientras vas haciendo...!!
thanks

good
No creo que fuera necesario el Progress, porque asi la funcion seria mas multiproposito.. Pero esta bueno tu código @</span>

Buenisimo me funciono perfecto en mi proyecto gracias