TeraCopy problem with integration into toolbar
Posted: 08 Jun 2019 18:01
I'm successfully using the following script in a user-created single toolbar button for Copy and Move to other pane:
This works OK. But when I break this script into two, separating the Copy part from the Move part and create new separate toolbar buttons, then only the Copy button works OK. The Move button moves the selected files OK, but when moving folders it ends with an error:
Unable to access:
followed by the path of the moved folder.
Ultimately, also the folder gets moved OK, but not without this error.
Why is this so and how to correct the used script:
Any advice would be most appreciated.
Code: Select all
"Copy to Other Pane"
$list = eval('%appdata%')."\TeraCopy\FileList.dat";
$teracopy = '"...\TeraCopy\TeraCopy.exe"'; // added real path
if(getinfo("FocusedControl") == "T"){
$items="<focitem>";
$selitems=1
} else {
focus l;
$items=getinfo("SelectedItemsPathNames");
$selitems=getinfo("CountSelected");
}
if($selitems<1){
status "Nothing selected!", , alert;
end 1;
}
$files = replace($items, "|", "<crlf>");
writefile($list, $files);
$copycmd = $teracopy.' copy *"'.$list.'" "<get path i>"';
open $copycmd,w;
"Move to Other Pane"
$list = eval('%appdata%')."\TeraCopy\FileList.dat";
$teracopy = '"...\TeraCopy\TeraCopy.exe"';
if(getinfo("FocusedControl") == "T"){
$items="<focitem>";
$selitems=1
} else {
focus l;
$items=getinfo("SelectedItemsPathNames");
$selitems=getinfo("CountSelected");
}
if($selitems<1){
status "Nothing selected!", , alert;
end 1;
}
$files = replace($items, "|", "<crlf>");
writefile($list, $files);
$copycmd = $teracopy.' move *"'.$list.'" "<get path i>"';
open $copycmd,w;
Unable to access:
followed by the path of the moved folder.
Ultimately, also the folder gets moved OK, but not without this error.
Why is this so and how to correct the used script:
Code: Select all
"Move to Other Pane"
$list = eval('%appdata%')."\TeraCopy\FileList.dat";
$teracopy = '"...\TeraCopy\TeraCopy.exe"';
if(getinfo("FocusedControl") == "T"){
$items="<focitem>";
$selitems=1
} else {
focus l;
$items=getinfo("SelectedItemsPathNames");
$selitems=getinfo("CountSelected");
}
if($selitems<1){
status "Nothing selected!", , alert;
end 1;
}
$files = replace($items, "|", "<crlf>");
writefile($list, $files);
$copycmd = $teracopy.' move *"'.$list.'" "<get path i>"';
open $copycmd,w;