TeraCopy Integration

Discuss and share scripts and script files...
Muroph
Posts: 561
Joined: 21 Aug 2007 16:13

Re: TeraCopy Integration

Post by Muroph »

i put the script for xy 7.60.0010 on my previous post.
My shared scripts:
TeraCopy Integration, Tag Manager, Comments Menu, Text Replacer, Image and Media Tools, Checksum Calculator, Video Calculator
only 5 URLs are allowed on the sig...

Muroph
Posts: 561
Joined: 21 Aug 2007 16:13

Re: TeraCopy Integration

Post by Muroph »

script changed for XYplorer 7.60.0017

Cut

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;
Copy

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;
Paste (same as previous version)

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;
My shared scripts:
TeraCopy Integration, Tag Manager, Comments Menu, Text Replacer, Image and Media Tools, Checksum Calculator, Video Calculator
only 5 URLs are allowed on the sig...

kawds
Posts: 4
Joined: 16 Oct 2008 17:14
Location: Aachen
Contact:

Re: TeraCopy Integration

Post by kawds »

I have placed all three scripts from the last post in seperate script files (tc_copy.xys, tc_cut.xys, tc_paste.xys) and loaded them via "Load Script File" but i still get the standard copy/move-operator.

All i did was changing the last script to:

Code: Select all

run """E:\_backup_\_profiles\TeraCopyPortable\teracopy.exe"" $op *""<xypath>\teracopylist.tmp"" ""$path\""";
BTW: I am using v7.70

kawds
Posts: 4
Joined: 16 Oct 2008 17:14
Location: Aachen
Contact:

Re: TeraCopy Integration

Post by kawds »

Now i understood the integration with CTRL+X/C/V.

But if I cancel the file-transfer with TeraCopy the destination file is not deleted, so there is a broken file in the destination with a size smaller than the original.

Muroph
Posts: 561
Joined: 21 Aug 2007 16:13

Re: TeraCopy Integration

Post by Muroph »

hmm...
i don't get any broken files here.
if a file is not completely copied/moved TC deletes it when the operation is canceled. :?

i'm running xy v7.70 too.
My shared scripts:
TeraCopy Integration, Tag Manager, Comments Menu, Text Replacer, Image and Media Tools, Checksum Calculator, Video Calculator
only 5 URLs are allowed on the sig...

Muroph
Posts: 561
Joined: 21 Aug 2007 16:13

Re: TeraCopy Integration

Post by Muroph »

TeraCopy Integration v5.0

EDIT: Updated "writefile" to v7.70.0007 syntax.

Needs XYplorer 7.70.0007 and TeraCopy 2.0b3 or later.

This is what i wanted from the begining.
The new script writes the items and the variables in separate files, fixing this bug.
And there's a bit more info on the statusbar message now.

Cut

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;
Copy

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;
Paste

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;
Last edited by Muroph on 24 Oct 2008 21:43, edited 1 time in total.
My shared scripts:
TeraCopy Integration, Tag Manager, Comments Menu, Text Replacer, Image and Media Tools, Checksum Calculator, Video Calculator
only 5 URLs are allowed on the sig...

admin
Site Admin
Posts: 60288
Joined: 22 May 2004 16:48
Location: Win8.1 @100%, Win10 @100%
Contact:

Re: TeraCopy Integration

Post by admin »

Muroph wrote:TeraCopy Integration v5.0...

Code: Select all

writefile("<xypath>\teracopylist.tmp", getinfo("SelectedItemsPathNames"), o, u);
In the upcoming version I add autodetection of ASCII/UNICODE for mode "t" so no need for "u" anymore which then will be called "tu". Since "t" and "o" are the defaults you can just leave out the arguments then:

Code: Select all

writefile("<xypath>\teracopylist.tmp", getinfo("SelectedItemsPathNames"));

lukescammell
Posts: 744
Joined: 28 Jul 2006 13:15
Location: Kent, UK
Contact:

Re: TeraCopy Integration

Post by lukescammell »

Thanks for all the hard work on this - the latest version works just great for me now :) (and with those tweaks Don mentioned as well).

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?
Used to update to the latest beta every day. Now I have children instead…
Windows 10 Pro x64 (everywhere except phone…)

Muroph
Posts: 561
Joined: 21 Aug 2007 16:13

Re: TeraCopy Integration

Post by Muroph »

updated for xy 7.70.07.
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?
hmm...
how can i check if a file exists without having to go to that file's path and without an error message if the file is not there?
My shared scripts:
TeraCopy Integration, Tag Manager, Comments Menu, Text Replacer, Image and Media Tools, Checksum Calculator, Video Calculator
only 5 URLs are allowed on the sig...

serendipity
Posts: 3358
Joined: 07 May 2007 18:14
Location: NJ/NY

Re: TeraCopy Integration

Post by serendipity »

I use teracopy a lot because I handle some really huge files and thanks to Muroph for updating this script which I heavily use.
Now, regarding what lukescammell asked, I became curious and found a (not so elegant) way to check if teracopy exists.
How it works: It goes to "Program files" directory and copies the Teracopy path to clipboard, obviously if it doesnt exist then clipboard is empty. Later the script chooses what to do based on the clipboard content. I know its not that cool, but it works. :)

To be frank I wont use it myself because i know all my computers have Teracopy, but I have this on my USB.

CUT

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 
COPY

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
PASTE

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

Muroph
Posts: 561
Joined: 21 Aug 2007 16:13

Re: TeraCopy Integration

Post by Muroph »

i just remembered that there's a free portable version of teracopy.
it shouldn't be hard to find.
i used it together with xy in my pendrive some time ago.
this way you can just change the script to use the portable exe and you'll *always* have tc installed.
My shared scripts:
TeraCopy Integration, Tag Manager, Comments Menu, Text Replacer, Image and Media Tools, Checksum Calculator, Video Calculator
only 5 URLs are allowed on the sig...

JohnM
Posts: 247
Joined: 08 Jun 2006 11:59
Location: Tasmania, Australia

Re: TeraCopy Integration

Post by JohnM »

Hi all,

I've been playing about with these scripts, they are great. I have set them up as UDC->run script and given them the CKS Ctrl-X/Ctrl-C.

However, did I miss something or does the "cut" and "copy" scripts not work when used on a TV item (ie folder) as opposed to a LV item (file)? More specifically, it appears that getinfo("SelectedItemsPathNames") does not return anything if used on a folder in the tree view. Is this correct?

Keep up the good work!

Cheers
JohnM
Windows 8.1 x64
XYplorer 22.90.0105 beta

Muroph
Posts: 561
Joined: 21 Aug 2007 16:13

Re: TeraCopy Integration

Post by Muroph »

this is a modified version that works on the tree.
i don't like it because it uses the clipboard (the "normal" version doesn't), and i always use RMB drag-n-drop when using teracopy on the tree.
the normal version is here.

so, here's the mod:

Cut

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;
Copy

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;
Paste

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;
My shared scripts:
TeraCopy Integration, Tag Manager, Comments Menu, Text Replacer, Image and Media Tools, Checksum Calculator, Video Calculator
only 5 URLs are allowed on the sig...

kartal
Posts: 208
Joined: 14 Aug 2008 18:06

Re: TeraCopy Integration

Post by kartal »

Hi

I am having problems with teracopy script in latest xyplorer(7.90.0050)

"getinfo" is not a valid command

Muroph
Posts: 561
Joined: 21 Aug 2007 16:13

Re: TeraCopy Integration

Post by Muroph »

kartal wrote:I am having problems with teracopy script in latest xyplorer(7.90.0050)

"getinfo" is not a valid command
hmm...
i'm used the script just a few seconds ago on 7.90.0050 and it was normal.
no idea what it might be.
i'm currently using the script from this post.
My shared scripts:
TeraCopy Integration, Tag Manager, Comments Menu, Text Replacer, Image and Media Tools, Checksum Calculator, Video Calculator
only 5 URLs are allowed on the sig...

Post Reply