Re: TeraCopy Integration
Posted: 16 Sep 2008 00:38
i put the script for xy 7.60.0010 on my previous post.
Forum for XYplorer Users and Developers
https://www.xyplorer.com/xyfc/
Code: Select all
//copy list of items to a variable
$items = getinfo("SelectedItemsPathNames");
//set list path
$list = "<xypath>\teracopylist.tmp";
//delete old list
setkey avoid possible, error, message, "$list";
delete 0,0, "$list";
//save operation and list of items
setkey move, teracopyop, tc, "$list";
setkey "<crlf>$items", teracopylist, tc, "$list";
status TeraCopy: Cut, 84C400, ready;
Code: Select all
//copy list of items to a variable
$items = getinfo("SelectedItemsPathNames");
//set list path
$list = "<xypath>\teracopylist.tmp";
//delete old list
setkey avoid possible, error, message, "$list";
delete 0,0, "$list";
//save operation and list of items
setkey copy, teracopyop, tc, "$list";
setkey "<crlf>$items", teracopylist, tc, "$list";
status TeraCopy: Copy, 84C400, ready;
Code: Select all
//save current path. this will be the target folder
set $path, "<curpath>";
//restore operation type
getkey $op, teracopyop, tc, "<xypath>\teracopylist.tmp";
//run teracopy.exe using command line parameters
//teracopy.exe [operation] *[list of source files] [target]
run """%programfiles%\TeraCopy\teracopy.exe"" $op *""<xypath>\teracopylist.tmp"" ""$path\""";
status TeraCopy: Paste, 84C400, ready;
Code: Select all
run """E:\_backup_\_profiles\TeraCopyPortable\teracopy.exe"" $op *""<xypath>\teracopylist.tmp"" ""$path\""";
Code: Select all
// save list of items
writefile("<xypath>\teracopylist.tmp", getinfo("SelectedItemsPathNames"));
// get number of items
$num = getinfo("CountSelected");
// save operation and $num
setkey move, operation, tc, "<xypath>\teracopyvars.tmp";
setkey $num, number, tc, "<xypath>\teracopyvars.tmp";
// finished
status "TeraCopy: Cut ($num item".(($num > 1)?"s":"").")", 78FF00, ready;
Code: Select all
// save list of items
writefile("<xypath>\teracopylist.tmp", getinfo("SelectedItemsPathNames"));
// get number of items
$num = getinfo("CountSelected");
// save operation and $num
setkey copy, operation, tc, "<xypath>\teracopyvars.tmp";
setkey $num, number, tc, "<xypath>\teracopyvars.tmp";
// finished
status "TeraCopy: Copy ($num item".(($num > 1)?"s":"").")", 78FF00, ready;
Code: Select all
//save current path. this will be the target folder
set $path, "<curpath>";
//get operation and number of items
getkey $op, operation, tc, "<xypath>\teracopyvars.tmp";
getkey $num, number, tc, "<xypath>\teracopyvars.tmp";
//run teracopy.exe using command line parameters
//teracopy.exe [operation] *[list of source files] [target]
run """%programfiles%\TeraCopy\teracopy.exe"" $op *""<xypath>\teracopylist.tmp"" ""$path\""";
status "TeraCopy: Paste ($num item".(($num > 1)?"s ":" ").(($op == copy)?"copied":"moved").")", 78FF00, ready;
Muroph wrote:TeraCopy Integration v5.0...
Code: Select all
writefile("<xypath>\teracopylist.tmp", getinfo("SelectedItemsPathNames"), o, u);
Code: Select all
writefile("<xypath>\teracopylist.tmp", getinfo("SelectedItemsPathNames"));
hmm...lukescammell wrote:Now I wonder if it's possible to make it so that the script can automatically/silently fall back to standard Cut/Copy/Paste if TeraCopy is not found? This way we could just remap CTRL+X/C/V to these scripts instead of the defaults and not have to worry about a target computer having TC installed or not. Possible?
Code: Select all
set $curpath, <curpath>;
$selected=getinfo("SelectedItemsPathNames", "|");
replace $selected, $selected, "<curpath>\","";
goto %programfiles%;
filter "Teracopy";
sel 1;
focus;
copytext <curitem>;
filter;
goto $curpath;
filter "$selected";
sel a;
sub choose
"_choose : choose"
set $clip, <clipboard>;
$choose= $clip > 1 ? "teracopy" : "wincopy";
sub "$choose";
"_Teracopy : teracopy"
// save list of items
writefile("<xypath>\teracopylist.tmp", getinfo("SelectedItemsPathNames"));
// get number of items
$num = getinfo("CountSelected");
// save operation and $num
setkey move, operation, tc, "<xypath>\teracopyvars.tmp";
setkey $num, number, tc, "<xypath>\teracopyvars.tmp";
// finished
status "TeraCopy: Cut ($num item".(($num > 1)?"s":"").")", 0000FF, ready;
filter
"_WindowCopy : wincopy"
//Cut selected files;
#200;
filter
Code: Select all
set $curpath, <curpath>;
$selected=getinfo("SelectedItemsPathNames", "|");
replace $selected, $selected, "<curpath>\","";
goto %programfiles%;
filter "Teracopy";
sel 1;
focus;
copytext <curitem>;
filter;
goto $curpath;
filter "$selected";
sel a;
sub choose
"_choose : choose"
set $clip, <clipboard>;
$choose= $clip > 1 ? "teracopy" : "wincopy";
sub "$choose";
"_Teracopy : teracopy"
// save list of items
writefile("<xypath>\teracopylist.tmp", getinfo("SelectedItemsPathNames"));
// get number of items
$num = getinfo("CountSelected");
// save operation and $num
setkey copy, operation, tc, "<xypath>\teracopyvars.tmp";
setkey $num, number, tc, "<xypath>\teracopyvars.tmp";
// finished
status "TeraCopy: Copy ($num item".(($num > 1)?"s":"").")", 0000FF, ready;
filter
"_WindowCopy : wincopy"
//Copy selected files;
#201;
filter
Code: Select all
set $curpath, <curpath>;
goto %programfiles%;
filter "Teracopy";
sel 1;
focus;
copytext <curitem>;
filter;
goto $curpath;
sub choose
"_choose : choose"
set $clip, <clipboard>;
$choose= $clip > 1 ? "teracopy" : "wincopy";
sub "$choose";
"_Teracopy : teracopy"
//save current path. this will be the target folder
set $path, "<curpath>";
//get operation and number of items
getkey $op, operation, tc, "<xypath>\teracopyvars.tmp";
getkey $num, number, tc, "<xypath>\teracopyvars.tmp";
//run teracopy.exe using command line parameters
//teracopy.exe [operation] *[list of source files] [target]
run """%programfiles%\TeraCopy\teracopy.exe"" $op *""<xypath>\teracopylist.tmp"" ""$path\""";
status "TeraCopy: Paste ($num item".(($num > 1)?"s ":" ").(($op == copy)?"copied":"moved").")", 0000FF, ready;
filter
"_WindowCopy : wincopy"
//Paste files;
#202;
filter
Code: Select all
//copy list of items to a variable
#101;
$items = "<clipboard>";
// save list of items
writefile("<xypath>\teracopylist.tmp", $items);
//save operation
setkey move, teracopyop, tc, "<xypath>\teracopyvars.tmp";
status TeraCopy: Cut, , ready;
Code: Select all
//copy list of items to a variable
#101;
$items = "<clipboard>";
// save list of items
writefile("<xypath>\teracopylist.tmp", $items);
//save operation
setkey copy, teracopyop, tc, "<xypath>\teracopyvars.tmp";
status TeraCopy: Copy, , ready;
Code: Select all
//save current path. this will be the target folder
$path = "<curpath>";
//restore operation
getkey $op, teracopyop, tc, "<xypath>\teracopyvars.tmp";
//run teracopy.exe using command line parameters
//teracopy.exe [operation] *[list of source files] [target]
run """%programfiles%\TeraCopy\teracopy.exe"" $op *""<xypath>\teracopylist.tmp"" ""$path\""";
status TeraCopy: Paste, , ready;
hmm...kartal wrote:I am having problems with teracopy script in latest xyplorer(7.90.0050)
"getinfo" is not a valid command