Page 1 of 1

Want: Copy To List

Posted: 09 Feb 2017 00:37
by Papoulka
I have two files selected, and on the clipboard a list of 500 paths gathered via "To Clipboard | Item Paths". I want a direct way to copy these two file to each of those paths.

My first thought is an option in "Edit | Copy To..." to paste the paths into the destination list. But there may be a better way, or an existing method that I have missed. I know it can be scripted but think it may well be appropriate as a native XY feature.

Re: Want: Copy To List

Posted: 09 Feb 2017 15:46
by admin
I have this on my list for a while now, but I never came around to implement it. Partly because it feels a bit like bloat. Give me a convincing reason and I'll add it...

Re: Want: Copy To List

Posted: 09 Feb 2017 18:12
by Jerry
I very often copy the same single file to each of several subfolders, with the latter capable of being specified with a wildcard expression. So the copyto() function does not accept a wildcard [location] or even a way to pickup selected target locations from the list? When I have a lot of these subfolders, I end up going into a unix shell on my PC to do it.

Re: Want: Copy To List

Posted: 09 Feb 2017 18:27
by admin
But why?

Re: Want: Copy To List

Posted: 09 Feb 2017 18:46
by Jerry
admin wrote:But why?
The most common use case is an album or boxed set parent folder containing many CD subfolders into which I want to copy an image file of the album cover so I can see it when playing the individual CDs. Another situation involves copying the same status marker or info file of some sort into a number folders, not necessarily subfolders under the same parent. My pathnames are often already near the max length allowed for Windows, so appending tokens to the folder names is usually not an option. For just status marking, I could use XY's tags, I suppose, but not for informational files.

UPDATE: Actually, I just discovered that with the music player I use, Foobar2000, I can have it look it for album coverart optionally, one or more directory levels up. But that may not be the case with other players.

Re: Want: Copy To List

Posted: 10 Feb 2017 03:48
by Papoulka
The most common use case is an album or boxed set parent folder containing many CD subfolders into which I want to copy an image file of the album cover
This is very close to my own case. In general, this need will arise occasionally when maintaining large collections.

So there is a predictable use for it. The questions are (a) whether that appears often enough in the XY community; (b) does this function fit in the model of a comprehensive file manager; and (c) how hard is it to work around.

I think the latter two argue for inclusion. It would not be out of place at all in XY, and there is no easy alternative that I know of - I'll have to script my present task. But how often it's needed is of course unclear except from requests.

Re: Want: Copy To List

Posted: 10 Feb 2017 04:29
by Jerry
Well, others here will have to weigh in if they care, but I think it's probably something that should just be scripted in a foreach loop instead of encumbering the API. The only reason I sometimes resort to doing this kind of thing outside of XY in a unix shell (using cygwin on the PC) is simply because I'm just too familiar with it, it's relatively simple since the shell environment takes care of a lot of things for you, and because shamefully, I'm not too eager these days to master yet another language. I mean, it doesn't get much easier than this:

Code: Select all

for f in CD*; do cp cover.jpg $f; done
or in your case, to copy 2 files to each path in a list of various paths:

Code: Select all

for p in $(<filepaths.txt); do cp file1 file2 $p; done

Re: Want: Copy To List

Posted: 10 Feb 2017 09:50
by admin
Frankly I don't think it's worth the trouble. I agree that it's a case for scripting.