TeraCopy Integration

Discuss and share scripts and script files...
jacky
XYwiki Master
Posts: 3106
Joined: 23 Aug 2005 22:25
Location: France
Contact:

Re: TeraCopy Integration

Post by jacky »

admin wrote:
Muroph wrote:
admin wrote:Holy crap, sounds complicated. What about a new scripting command that will return any of the lists featured under List Management, say as a 0-separated list?
that would make things much easier. :)

but would it be useful for anyone else?
Only anyone else can answer that...
Am I anyone else? Alright, then I would imagine so, yes. I know there's a script of mine whose purpose is to read my XY.ini in order to get the list of Highlighted Folders, because I need some scripts to know which folders are set to what colors, so those could be useful & avoid some disk operations, etc. (Not to mention reflect the reality of things, and not what was true on last save.)
As for MRUs, any script that wishes to work with those features and wants to "integrate" nicely could use access to those list, as seem to be the case here (I haven't followed this thread all that much).

To sum up: I vote yes, I think it'd be useful.

Edit: Of course, for that and so many other things, arrays would be a great useful addition to scripting... ;) 8)
Proud XYplorer Fanatic

TheQwerty
Posts: 4373
Joined: 03 Aug 2007 22:30

Re: TeraCopy Integration

Post by TheQwerty »

I don't think there's anything you can add to Scripting that we couldn't find a use for, Don. ;)

jacky
XYwiki Master
Posts: 3106
Joined: 23 Aug 2005 22:25
Location: France
Contact:

Re: TeraCopy Integration

Post by jacky »

TheQwerty wrote:I don't think there's anything you can add to Scripting that we couldn't find a use for, Don. ;)
Don't underestimate him. I'm sure if he wanted to, he could! :P
Proud XYplorer Fanatic

nas8e9
Posts: 2232
Joined: 21 Jun 2008 14:50

Re: TeraCopy Integration

Post by nas8e9 »

I hope I'm not complicating things, but my question was solely about pane.ini and not the tab_?.dat files. Your script already contains the logic to backup XYplorer.ini; could you use the same function to just backup pane.ini?

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

Re: TeraCopy Integration

Post by Muroph »

nas8e9 wrote:I hope I'm not complicating things, but my question was solely about pane.ini and not the tab_?.dat files. Your script already contains the logic to backup XYplorer.ini; could you use the same function to just backup pane.ini?
i could, but Don said i shouldn't. :wink:
admin wrote:
Muroph wrote: 2. can i safely ignore them during the backup? (this would make things much easier)
The tab.dat files store the find files settings of each tab (as it says in the first line of each tab.dat :wink: ) They should not be ignored.
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...

nas8e9
Posts: 2232
Joined: 21 Jun 2008 14:50

Re: TeraCopy Integration

Post by nas8e9 »

@Muroph:

At the moment TeraCopy (specifically the 2.06 beta) is not in great shape. kiku has kindly posted a much simplified version of your TeraCopy script to integrate with FastCopy. To me (and possibly only to me :mrgreen: ), this begs the question whether a generalized script to support both TeraCopy and FastCopy (and possibly other such programs) would be a good idea: it seems wasteful to reinvent the wheel for each such program and your script is the most complete and advanced of the two that are currently available.

After trying :| to go through the TeraCopy script (advanced is definitely the word I'm looking for), it seems the only needed changes to your script to support FastCopy are the three "open" commands. The "open" commands consist of three variable parts: the complete path of the program file, the desired command (TeraCopy calls copying copy while FastCopy calls it diff, etc.) and finally any additional parameters for each program. Both programs accept the name of a text file with the list of items to be acted upon, as a parameter, so no problems there.

Would it be possible to generalize the TeraCopy script so that changing between TeraCopy, FastCopy and possibly other such programs is a question of changing a single constant (well, variable at the moment) with an if/else block setting the parameters for the know copying programs?

Just curious...

kiku
Posts: 141
Joined: 02 Jun 2008 22:32

Re: TeraCopy Integration

Post by kiku »

I'm not a scripting expert, so I leave it in the hands of Muroph to adapt his Teracopy script to integrate Fastcopy or any other copy program available :)

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

Re: TeraCopy Integration

Post by Muroph »

i like the idea, but it will take a while to do it.
things have been kind of busy in real life.

btw, i have the fixed version of the teracopy script waiting to be tested for more than a week.
i could post it here if anyone wants, and is willing to take the risk. :mrgreen:
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 »

finally i got some free time to work on this script.

the new version does not need to save your settings to load the copy and move to menus (and now these menus have icons).

i also added a tweak to change the command line used to call the copy handler.
this should add support for programs other that teracopy.
however, i only tested it with teracopy, so i need feedback on this feature ASAP.
things will probably get hectic IRL again starting next monday, and then i won't have much time to work on the script (except for very simple things).

how the command line works:
there are 2 variables, $copycmd and $movecmd, where you can set the command line for the copy and move operations.
you can find them in the settings subscript.
inside those variables you can/must use 3 pseudo-variables to place the path to the copy handler executable, the list of items to copy/move, and the target folder.
they are: <exe-path>, <source-list> and <target-path>.
for example:

Code: Select all

$copycmd='"<exe-path>" -op copy -list "<source-list>" -dest "<target-folder>"';
$movecmd='"<exe-path>" -op move -list "<source-list>" -dest "<target-folder>"';
note that the script will only work with programs that can take the list of items as a text file (with one item per line).

the bad news is that there is a possible bug:
when using the copy/move to commands no tags and comments where set for the new files.
the tag and comment commands wouldn't even work as quick-scripts on the address bar.
i could not find any reason for that, and it stopped after i restarted XY (actually, my pc).

because of this, and the not completely tested command line, i'd say this script is a beta version.
if i can't reproduce the bug, and no one complains about it in the next few days, i'll change this to a "official" version.
teracopy6.8beta.xys
(32.74 KiB) Downloaded 168 times
BTW, i have no idea what is the minimum XY version needed to run it, but i didn't use any of the recently converted functions.
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...

nas8e9
Posts: 2232
Joined: 21 Jun 2008 14:50

Re: TeraCopy Integration

Post by nas8e9 »

Muroph wrote:finally i got some free time to work on this script.

the new version does not need to save your settings to load the copy and move to menus (and now these menus have icons).

i also added a tweak to change the command line used to call the copy handler.
this should add support for programs other that teracopy.
however, i only tested it with teracopy, so i need feedback on this feature ASAP.
First of all, thank you for the new version!

The following tweaks enable FastCopy to be used instead of TeraCopy (well, on my computer... :)):

Code: Select all

	//tweak #3
//TeraCopy
//	$copycmd='"<exe-path>" copy *"<source-list>" "<target-folder>"';
//	$movecmd='"<exe-path>" move *"<source-list>" "<target-folder>"';
//FastCopy
	$copycmd='"<exe-path>" /cmd=diff /open_window /auto_close /estimate /verify /srcfile="<source-list>" /to="<target-folder>"';
	$movecmd='"<exe-path>" /cmd=move /open_window /auto_close /estimate /verify /srcfile="<source-list>" /to="<target-folder>"';
and

Code: Select all

//TeraCopy
//	$teracopypath=("$teracopypath"!="")?($teracopypath):('C:\Program Files\TeraCopy\teracopy.exe');
//FastCopy
	$teracopypath=("$teracopypath"!="")?($teracopypath):('%ProgramFiles%\FastCopy\FastCopy.exe');
You may wish to mark the $teracopypath as the fourth tweak.

By the way, there is a problem on 64-bit Windows with parsing the path to TeraCopy.exe: XYplorer, being 32-bit, resolves %ProgramFiles% to \Program Files (x86) instead of \Program Files. TeraCopy 2.x installs in \Program Files on Vista x64 and Windows 7 x64. That's why in the above code I needed to hard-code the path to TeraCopy. It's not a big problem: both Vista as well as Windows 7 always set the Windows partition to C:.

Finally, I don't see the bug with tags and comments: both the original file as well as the copy have the set tag and comments which remain editable.

nas8e9
Posts: 2232
Joined: 21 Jun 2008 14:50

Re: TeraCopy Integration

Post by nas8e9 »

Muroph wrote:finally i got some free time to work on this script.
By way of one small and one rather large feature request:

I don't exactly have perfect eyesight but I find the custom green colors you use in your script make it hard to read the text. I don't know whether that's a problem for others but could you use a more legible green or allow customization through a single constant/variable?

The larger feature request: one of the joys of the Copy To/Move To - Select Destination Folder dialog box is its persisting the last used folder. As a result, to copy/move a further file/folder to the same folder can be achieved by just pressing Enter after Ctrl/Shift+F7.

Since 8.40.0101 (with changes in 8.40.0102), XYplorer allows the visual display of a default item in a menu:

Code: Select all

    + Scripting: Changed yesterday's syntax for item states. No more
      prefixed "+" or "!". Now you define the states Default (Bold),
      Checked, and Disabled by combining binary values.
        Syntax:
          "Caption|Icon|State : Label" Script
        where
          State Default = 1
          State Checked = 2
          State Disabled = 4
      For example:
        "Go C:|C:|1" goto "C:\";  //shown bold
        "Go D:|D:|2" goto "D:\";  //shown checked
        "Go E:|E:|3" goto "E:\";  //shown bold and checked
I'm not sure whether setting an item to Default (Bold) also focuses it; if so, it would allow Ctrl/Shift+F7, Enter to use the previously used folder and also to be close to a "nearby" folder. For instance, I have a folder structure like

\Data\A
\Data\B
\Data\C.

With several more, much different folders in the Move/Copy/Backup To-list and a bunch of files to move to either A, B or C, having your script persist and focus the last used folder either to use itself or to move to a neighboring folder would be a huge usability win for me.

I appreciate that you won't be able to do major work in the near future on your script; if you'd consider the above points in the next round I'd be very grateful. Regardless, thank you very much for your great script!

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

Re: TeraCopy Integration

Post by Muroph »

You may wish to mark the $teracopypath as the fourth tweak.
you can change it using the "configure" command in the menu.
you wil see a bunch of dialogs where you can change this as well as some other script settings.
btw, i'll try to make a more user-friendly settings dialog soon.
By the way, there is a problem on 64-bit Windows with parsing the path to TeraCopy.exe: XYplorer, being 32-bit, resolves %ProgramFiles% to \Program Files (x86) instead of \Program Files. TeraCopy 2.x installs in \Program Files on Vista x64 and Windows 7 x64.
yep, i know.
that's one of the reasons why the path to teracopy.exe is customizable.
I don't exactly have perfect eyesight but I find the custom green colors you use in your script make it hard to read the text. I don't know whether that's a problem for others but could you use a more legible green or allow customization through a single constant/variable?
i had the same idea a few times in the past (mainly when i changed my OS skin), but never remember to actually do it. :P
it's easy to do and, more importantly, doesn't need tons of tests to make sure it's working. :lol:
the next version will have it.
btw, i chose the current colors exactly because they are easy to read in the skins i use (which are usually dark-gray or black).
The larger feature request: one of the joys of the Copy To/Move To - Select Destination Folder dialog box is its persisting the last used folder. As a result, to copy/move a further file/folder to the same folder can be achieved by just pressing Enter after Ctrl/Shift+F7.
hmm... interesting idea
i confess i haven't used the menu flags yet, and i don't know exactly how it works.
however, since that menu is not hard-coded on the script, this is probably easy to implement.
i'll give it a try.
Finally, I don't see the bug with tags and comments: both the original file as well as the copy have the set tag and comments which remain editable.
i haven't seen it again either, so i'll move the script to the "official" post later.
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...

nas8e9
Posts: 2232
Joined: 21 Jun 2008 14:50

Re: TeraCopy Integration

Post by nas8e9 »

Muroph wrote:
You may wish to mark the $teracopypath as the fourth tweak.
you can change it using the "configure" command in the menu.
you wil see a bunch of dialogs where you can change this as well as some other script settings.
btw, i'll try to make a more user-friendly settings dialog soon.
I missed that due to the fact that I always use copyto and moveto rather than executing the whole script.
Muroph wrote:
I don't exactly have perfect eyesight but I find the custom green colors you use in your script make it hard to read the text. I don't know whether that's a problem for others but could you use a more legible green or allow customization through a single constant/variable?
i had the same idea a few times in the past (mainly when i changed my OS skin), but never remember to actually do it. :P
it's easy to do and, more importantly, doesn't need tons of tests to make sure it's working. :lol:
the next version will have it.
btw, i chose the current colors exactly because they are easy to read in the skins i use (which are usually dark-gray or black).
I may use Windows 7, but I use the Windows Classic theme...:mrgreen: Thank you!
Muroph wrote:
The larger feature request: one of the joys of the Copy To/Move To - Select Destination Folder dialog box is its persisting the last used folder. As a result, to copy/move a further file/folder to the same folder can be achieved by just pressing Enter after Ctrl/Shift+F7.
hmm... interesting idea
i confess i haven't used the menu flags yet, and i don't know exactly how it works.
however, since that menu is not hard-coded on the script, this is probably easy to implement.
i'll give it a try.
Looking forward to it!

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

Re: TeraCopy Integration

Post by admin »

BTW, I've read that %ProgramW6432% defaults to "C:\Program Files" for 32 and 64 bit apps. Can't test it here.

nas8e9
Posts: 2232
Joined: 21 Jun 2008 14:50

Re: TeraCopy Integration

Post by nas8e9 »

admin wrote:BTW, I've read that %ProgramW6432% defaults to "C:\Program Files" for 32 and 64 bit apps. Can't test it here.
It does indeed; in all, enough ways to circumvent this quirk in scripting under 64-bit Windows.

Post Reply