TeraCopy Integration

Discuss and share scripts and script files...

Re: TeraCopy Integration

Postby Muroph » 15 Sep 2008 23:38

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 15:13

Re: TeraCopy Integration

Postby Muroph » 19 Sep 2008 13:15

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...
Muroph
 
Posts: 561
Joined: 21 Aug 2007 15:13

Re: TeraCopy Integration

Postby kawds » 17 Oct 2008 11:36

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 16:14
Location: Aachen

Re: TeraCopy Integration

Postby kawds » 17 Oct 2008 16:05

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.
kawds
 
Posts: 4
Joined: 16 Oct 2008 16:14
Location: Aachen

Re: TeraCopy Integration

Postby Muroph » 17 Oct 2008 20:29

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 15:13

Re: TeraCopy Integration

Postby Muroph » 21 Oct 2008 17:37

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 20: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...
Muroph
 
Posts: 561
Joined: 21 Aug 2007 15:13

Re: TeraCopy Integration

Postby admin » 22 Oct 2008 17:07

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"));
admin
Site Admin
 
Posts: 32417
Joined: 22 May 2004 15:48
Location: Cologne

Re: TeraCopy Integration

Postby lukescammell » 23 Oct 2008 23:52

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 7 x64 Home Premium (at home) | Windows 7 x64 Pro (on laptop) | Windows 7 x64 Ultimate (at work)
lukescammell
 
Posts: 725
Joined: 28 Jul 2006 12:15
Location: Kent, UK

Re: TeraCopy Integration

Postby Muroph » 24 Oct 2008 21:01

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...
Muroph
 
Posts: 561
Joined: 21 Aug 2007 15:13

Re: TeraCopy Integration

Postby serendipity » 25 Oct 2008 05:19

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
serendipity
 
Posts: 3317
Joined: 07 May 2007 17:14
Location: NJ/NY

Re: TeraCopy Integration

Postby Muroph » 25 Oct 2008 05:40

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...
Muroph
 
Posts: 561
Joined: 21 Aug 2007 15:13

Re: TeraCopy Integration

Postby JohnM » 12 Nov 2008 11:39

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 13.60.0013 (beta)
JohnM
 
Posts: 144
Joined: 08 Jun 2006 10:59
Location: Tasmania, Australia

Re: TeraCopy Integration

Postby Muroph » 25 Nov 2008 20:39

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...
Muroph
 
Posts: 561
Joined: 21 Aug 2007 15:13

Re: TeraCopy Integration

Postby kartal » 16 Jan 2009 17:50

Hi

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

"getinfo" is not a valid command
kartal
 
Posts: 208
Joined: 14 Aug 2008 17:06

Re: TeraCopy Integration

Postby Muroph » 19 Jan 2009 18:58

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...
Muroph
 
Posts: 561
Joined: 21 Aug 2007 15:13

PreviousNext

Return to Script Exchange



Who is online

Users browsing this forum: No registered users and 2 guests

cron