Windows - Multiple file search and copy

Damian Brown

Suspended / Banned
Messages
2,685
Name
Damian Brown
Edit My Images
No
So I'd like to copy a text list of files, ie photos of various file numbers that are all found in one folder. Then in one swift move select only those files in the folder and copy them. Or at least the first stage. Trying to speeden up the process of selecting 60+ images in a folder and copying them to another.

Any ideas?
 
Nooooo :D

That's what I've been doing (well ctrl+c instead of dragging)

I want to use the text file containing the whole list (imagine you have a list of photos that a client or friend wants)

Then stick it in some form of search function, and all at once let it select the files.

Lightroom Transporter is a similar feature I'm told but I use Bridge/Photomechanic and haven't spotted how to do it on there yet. Just the standard search, and by standard I mean individual file.
 
If you can get all the filenames on a single line, just fire up a command line and use the command:

copy <list of filenames here> directory

Copy can handle multiple files to a single directory.
 
What about a Bridge script to read the text file and create a collection of the found documents.
 
If you can get all the filenames on a single line, just fire up a command line and use the command:

copy <list of filenames here> directory

Copy can handle multiple files to a single directory.


Very interesting! Would that be separated by a comma or anything? I'm not great with commands.
 
Very interesting! Would that be separated by a comma or anything? I'm not great with commands.
Ooops... my bad. It appears MS copy doesn't allow you to do this (I run a Unix-like command system on my windows machine). xcopy does allow you to exclude files from a copy but the syntax is a bit tortuous... http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/copy.mspx?mfr=true

I have to say missing that level of functionality is a tad of an oversight from MS.
 
Just create a batch file with all the file names in it, using the move command.
You can use wildcard symbols to use partial filenames.
 
Sounds great but I'm a command novice. I can get the command box open and that's it unless I have a command to copy off the net or someone
 
If you are still interested in automating...

Here is an example of doing this in Bridge
This requires a text file with one filename per line!


Copy and paste the script into ExtendScript Toolkit
This gets installed with Photoshop and can be found:-
PC: C:\Program Files\Adobe\Adobe Utilities
MAC: <hard drive>/Applications/Utilities/Adobe Utilities

Start Bridge
PC: Edit - Preferences - Startup Scripts
Mac: Adobe Bridge menu - Preferences - Startup Scripts
At the bottom click the "Reveal Button" this will open the folder where the script should be saved.
Close and restart Bridge.
Accept the new script.

To Use:-
Open Bridge
Goto the folder holding your files.
You will now have a new Menu "Client Pictures" select "Get Client Pics" from this menu.
You will be presented with an User Interface for you to select the text file.
Once you click the process button the script will create a new folder off the selected folder called "Client Order"
All found files will be copied into this folder, an error file will be created in this folder if any files are not found.
The new folder will then be presented to you along with the error file if errors exist.

Code:
#target bridge   
if( BridgeTalk.appName == "bridge" ) {  
var cPics = new MenuElement( "menu", "Client Pictures", "after Help", "cPics" );
var getPics = new MenuElement( "command", "Get Client Pics", "at the end of cPics" , "xxxx" );
}
getPics.onSelect = function () { 
	  getDemPics();
	  }
function getDemPics(){
var win = new Window('dialog','Get Pics');
win.pn1 = win.add('panel', undefined, undefined, {borderStyle:"black"}); 
win.grp1 = win.pn1.add('group');
win.grp1.st1 = win.grp1.add('statictext',undefined,"Find Pictures");
win.grp1.st1.graphics.font = ScriptUI.newFont("Georgia","BOLDITALIC",22);
win.grp2 = win.pn1.add('group');
win.grp2.st1 = win.grp2.add('statictext',undefined,'Select Text File... ');
win.grp2.et2 = win.grp2.add('edittext');
win.grp2.et2.preferredSize=[250,20];
win.grp2.et2.enabled=false;
win.grp2.bu1 = win.grp2.add('Button',undefined,'Select');
win.grp2.bu1.onClick = function() {
 txtFile = File.openDialog("Open Text File","Text(*.txt):*.txt;");
if(txtFile != null){
	win.grp2.et2.text = decodeURI(txtFile.fsName);
	}
}
win.grp3 = win.pn1.add('group');
win.grp3.bu1 = win.grp3.add('button',undefined,'Process');
win.grp3.bu1.preferredSize=[200,30];
win.grp3.bu2 = win.grp3.add('button',undefined,'Cancel');
win.grp3.bu2.preferredSize=[200,30];
win.grp3.bu1.onClick = function(){
    if(win.grp2.et2.text == ''){
        alert("No TEXT file has been selected!");
        return;
        }
    win.close(1);
var fileList =[];
datafile = new File(txtFile); 
datafile.open('r') ; 
while(!datafile.eof){   
   strInputLine = datafile.readln(); 
   if (strInputLine.length > 3) { 
	fileList.push(strInputLine.replace(/^\s+/,''));
		}   
	}
datafile.close();
var Path =app.document.presentationPath;
var outFolder= Folder(app.document.presentationPath+"/"+"Client Order");
if(!outFolder.exists) outFolder.create();
var notFound=[];
for(var a in fileList){
    var file = File(Path+"/"+fileList[a]);
    var To = File(outFolder+"/"+fileList[a]);
    if(file.exists){
        file.copy(To);
        }else{
            notFound.push(fileList[a]);
            }
    }
if(notFound.length >0){
var error = new File(outFolder + "/Error Log.txt");
error.open("w", "TEXT", "????");
$.os.search(/windows/i)  != -1 ? file.lineFeed = 'windows'  : file.lineFeed = 'macintosh';
error.writeln("Files not found...");
for(var a in notFound){
    error.writeln(notFound[a].toString());
    }
error.close();
error.execute();
    }
app.document.thumbnail = new Thumbnail(outFolder);
}
win.show();
}
 
Thanks a lot for posting that! I appreciate it. I will be trying this out definitely.
 
I´ve got as far as getting the Client Pictures menu and clicking get client pics but nothing happens after. I've confirmed the code has been copied correct but it's not moving. Any ideas?
 
It sound as if you haven't got the whole script, as you should get a user interface when selecting "Get Client Pics". Can you check you have got the last curly bracket as this would stop the script working.
 
Yep, copied and pasted it a few times now and checked the curly bracket. Still not getting the user interface. Will try a simple restart on the pc as well
 
Another thought, are you using CS2? if so you will have to remove line 14
win.grp1.st1.graphics.font = ScriptUI.newFont("Georgia","BOLDITALIC",22);
as cs2 doesn't understand ScriptUI
 
Found the problem, it is line 23
win.grp2.bu1 = win.grp2.add('Button',undefined,'Select');
button should all lowercase
win.grp2.bu1 = win.grp2.add('button',undefined,'Select');

I was using CS5 and it doesn't matter there, sorry.
 
I'm hoping to go to CS5 this year, love the content aware fill.. looks like magic!

Thanks so much. I'm going to do this now and report straight back
 
Great, that's brought the box up. Now.. I have to ask a really stupid question regarding the text file... format related.

I have the list I'm using as an example in a text doc at the mo, taken from the email. Currently it reads downwards, for example:

014.jpg
015.jpg
019.jpg
 
Mate you're an absolute genius, a credit to your nation!
 
Glad it's working for you now!
By the way CS5 is a bit of a dissapointment as most of the effort went in to get 64bit working on the Mac, I hope that we can can more features and a lot more bug fixs in CS6.
 
Serious? I'm on 64 bit windows 7.. was hoping it'd be worth the upgrade speed wise, though I imagine i'd have to set up the actions and shortcuts all over again. But to save time I'm all for it.

This script is mint Paul!
 
Back
Top