Page 1 of 3

Multi-Copy/Paste v3.0

Posted: Fri 23 Mar 2012, 22:34
by SFR
From time to time someone complains about lack of multi copy/paste feature in ROX's context menu.
Sometimes I lament also, therefore I decided to cut it out and made a simple substitute.
(I hope I didn't reinvent anything already existing?)

The attached .pet adds three entries to right-click "Open With..." list: Multi-Copy (Add), Multi-Copy (New) and Multi-Paste
Why "Open With..."? It's the only customizable item which I've found available when selecting many objects...

Multi-Copy (New) creates a new list of items to be copied.
Multi-Copy (Add) adds selected items to existed list.
Multi-Paste opens xterm window and starts copying (cp with -r and -i options).
Thanks to xterm output, if an error will occur or there will be a need to overwrite something, you'll be notified.

Usage:
1. Browse to source place -> select one or more file(s)/folder(s) -> right-click -> Open With... -> Multi-Copy (New) or Multi-Copy (Add)
2, If needed - repeat 1st step (using Multi-Copy (Add)).
3. Browse to destination place -> select one or more folders -> right-click -> Open With... -> Multi-Paste
After copying there's opportunity to delete ALL source files and folders (rm with -r and -f options). <- carefully with that!
If source items won't be deleted, they're still available for further pasting...

That's it.

Limitation:
Doesn't work on "top" of filesystem(s), I mean one cannot paste item(s) directly into, eg. /, there must be specific folder or folders selected.
It's the matter of ROX (or my ignorance?) - right clicking on empty space won't bring up "Open With..." list.

I ran several tests on Lupu, Slacko, Wary and Pizzasgood's "Puppy 4.2.1 Multiuser r3" (so, hopefully it should work on other older Puppies too) - and suprisingly everything seems to work well...
Just in case: please don't trust me and use it carefully.

BTW, I was going to add Xdialog UI + some enhancements, but instead I've chosen to simplify it as much as possible.
It's just copying - should be fast, transparent and without bells & whistles.
(A little Angel on my right shoulder calls it "a well justified laziness").
But if someone more skilled would like to enhance this app - feel free!

Written on Lupu-528.004.
___________

Changelog

Update 2012-03-26, version 1.1:
- Displays short usage instruction during installation.
- If there were copying errors, opportunity to delete source objects is disabled.

Update 2013-11-03, version 2.0:
- Complete rewrite, see this post for details.

Update 2013-11-03, version 2.1:
- restored ability to paste into multiple folders at once
- copying/moving doesn't start in "Quiet" mode (requires confirmation)
- new icons

Update 2014-08-10, version 2.2:
- withdrawn: "copying/moving doesn't start in "Quiet" mode (requires confirmation)"
- right-click shortcuts for "Multi-Cut/Multi-Copy" added to individual filetypes and "MultiPaste" to directory/mountpoint, so when selecting a single folder/file, Multi-* options are accesible directly (in case of multiple folder/files - still via "OpenWith" though)
- can create shortcuts on the pinboard, onto which one can drop folders/files to be copied
- pinstall.sh is now "woof-friendly"

Update 2016-12-12, version 3.0:
- complete rewrite
- combines modes from 1.x and 2.x branches

Classic:
- Multi-Cut
- Multi-Copy
- Multi-Paste
(requires no explanation, I believe)

Modern:
- Multi-Add-New: adds selected items to new list
- Multi-Add-Merge: adds selected items to the existing list
- Multi-Copy-To: copies items from the list into selected directory/ies
- Multi-Move-To: moves items from the list into selected directory (only one target dir allowed)

Greetings!

Posted: Sun 25 Mar 2012, 22:21
by SFR
Tiny update:
- Displays short usage instruction during installation.
- If there were copying errors, opportunity to delete source objects is disabled.

First post updated.

Greetings!

Posted: Sun 25 Mar 2012, 22:42
by darkcity
It's the matter of ROX (or my ignorance?) - right clicking on empty space won't bring up "Open With..." list.
you can use 'next click' -> Open With...'

the pointer will turn into cross, then you can select directory.Image

Posted: Sun 25 Mar 2012, 22:59
by SFR
darkcity wrote:
It's the matter of ROX (or my ignorance?) - right clicking on empty space won't bring up "Open With..." list.
you can use 'next click' -> Open With...'

the pointer will turn into cross, then you can select directory.Image
Oh, I didn't make myself clear enough. :oops:
The limitation I mean is that even with that 'cross' I can't point most-top folder, which is /, it works only with folders contained in /.

Thanks anyway :)
Greetings!

Posted: Fri 30 Mar 2012, 02:58
by disciple
If you wanted you could add a step in Multi-Paste where it tells you the path you have selected to Paste to, and allows you to edit that before starting the paste.

But maybe it is good to make it hard to paste into / - people should really keep their filesystems clean, after all.

Posted: Fri 30 Mar 2012, 04:49
by Flash
SFR, could you give an example of how this might be used? Thanks. :)

Posted: Fri 30 Mar 2012, 09:35
by SFR
@disciple:
That would do the trick indeed, thanks!
But actually you're right about / - I can't recall a single time I needed to paste anything to /.
So, let's say it's not "a limitation" anymore, now it's "a feature". :wink:

@Flash:
The idea is to avoid annoying one-by-one copy/paste actions from several places to another several places.
Let's say I want to copy a few mp3s from one folder, a few from another one (and so on) to one, specific destination place.
Normaly I must open two ROX windows and do it by drag'n'dropping, for files in each folder individually...or worse, using right-click's copy, every single file individually!
Now it's enough to select few mp3s -> Multi-Copy (New), then go to another folder and select again with Multi-Copy (Add) and so on, and then navigate to destination place and use Multi-Paste.
All previously selected files will be pasted at once and everything can be done within one window.
Since I started to use this app I got used to it so much, that almost stopped to use in-built copy function, even for single files. :lol:

Greetings!

new feature

Posted: Sat 31 Mar 2012, 20:18
by don570
It worked well when I tried it in the newest Exprimo by Pemasu 8)

A suggestion for a new feature:


Check if the file that is copied is null i.e. empty

Then when you paste that file ask the user if multiple copies
are desired (with different names of course)

I find that multiple copies of an empty file are useful when I test a script.

Here's a website that shows how to create multiple files with the
'touch' command
http://www.linuxnov.com/how-to-add-mult ... mand-line/

______________________________________________

Posted: Sun 01 Apr 2012, 16:52
by SFR
Thanks for the feedback Don :)

As for the feature:
I'm not sure I fully get it :oops: , could you provide a specific example?

But I guess it's somehow related to your rename-files.pet, isn't it?
If I understand correctly the idea is to check a file, when copying, if it has 0 byte size, and then ask the user for multiplying it to the destination folder(s), using 'touch'.
If so, please don't get me wrong, but wouldn't be just easier to create a separate right-click app purposed to fill selected folder with given amount of empty files?
I imagine the core could look like:

Code: Select all

eval touch '"$filename"'_{1..$amount}.'"$extension"'
(Thanks for the link, by the way, didn't know that 'touch' can be used with {1..x})
or using /dev/urandom to create some random-named files, for testing purposes...

...unless I misunderstand. 8)

Greetings!

empty-files app

Posted: Mon 02 Apr 2012, 21:27
by don570
I quickly wrote an app over the weekend to
make empty files

http://murga-linux.com/puppy/viewtopic. ... 790#616790

It could be of use for programmers.

_________________________________________________-

Posted: Mon 02 Apr 2012, 21:37
by don570
Image

Posted: Mon 02 Apr 2012, 22:00
by SFR
Thank you, I'm starting to see the value of such option! :)

BTW, thanks very much for the info from your Rename-files thread.
the command mv -n
doesn't work on Puppy Linux (other than Lucid Puppy)
I_had_no_idea that there could be so cunningly hidden "little" differences (even on such basic levels) between Puppies!!! :shock:

Well, one must live long to learn. 8)

Greetings!

Posted: Mon 02 Apr 2012, 23:41
by disciple
I'm starting to see the value of such option!
I think you were right before when you said it was more appropriate as a separate app. It's a completely different use case, only really useful for developers.

Posted: Tue 03 Apr 2012, 16:04
by don570
I use it to quickly make some files to test programs,

but I've thought about a crude replacement of a database.

For instance a teacher has 30 students and they are numbered.

The teacher could quickly create 30 files in a folder and put
the exam results in the files.

_____________________________________________________

Posted: Tue 03 Apr 2012, 20:54
by disciple
Interesting.
I think a singe spreadsheet would generally make a better database though.

Posted: Tue 03 Apr 2012, 22:40
by SFR
disciple wrote:
I'm starting to see the value of such option!
I think you were right before when you said it was more appropriate as a separate app. It's a completely different use case, only really useful for developers.
Yup, I'm still there; I meant 'option' in general, as an app.
...I failed again while Thought > Word (apparently I'm still in beta stage :oops:).

8)
Greetings!

Posted: Sat 07 Apr 2012, 03:37
by disciple
Users should also be aware of the drag and drop capability of Rox's copy and rename dialogues. As described in the comments at http://sourceforge.net/tracker/?func=de ... tid=357023

Posted: Sat 07 Jul 2012, 18:04
by saintless
Hi, SFR :)

Thank you very much for this new option for Rox. It is exactly what I was wondering how to make possible. Your pet package saves me a lot of hard work which probably was going to reach a dead end.

I ask for your permission to include your scripts as a copy-paste option in a remastered version of Sickgut's Pussy-linux. Do you mind if I also do some small modifications with the paths inside the script?

Thanks again and best regards :)

Posted: Sat 07 Jul 2012, 20:12
by SFR
Hey Saintless, nice to see you! :)

Naturally, you can modify it as you wish and put wherever you want.
You didn't even have to ask, but it's nice of you.

And I'm glad you have found it useful.

Thanks & Greetings!

Posted: Sat 07 Jul 2012, 21:21
by saintless
Thanks, SFR, nice to see you too :)

The main town is much bigger than the village and it is like we don't go often in the same places but the important thing is we are here and we will meet again.

Cheers