Jump to content
Macro Express Forums

Move Images (files) to Predefined Folders


RobHat
 Share

Recommended Posts

Greetings,

 

Using Macro Express Standard. Win7 OS.

 

I have a little over 12 million jpg image files which need to be sorted into predefined folders. Is there a way to script a way I can simply assign a destination folder to numpad1 on through numpad9 for 9 folders which I can have the mouse left click on the image thumbnail, cut, and paste the file into the predefined folder?

 

Even if it's a simple copy/paste I am betting its possible to script a delete function to get rid of the originally copied file.

 

I find it very slow to click/drag image files into appropriate folders or tag each image. If there is a way I can just use my numpad to speed through these files, sorting them, this would be great. If the answer is not with this scripting prog, please clue me in. Thanks so very much.

 

Love MacEx, long time user.

 

~Rob.

  • Like 1
Link to comment
Share on other sites

Are you really working with, literally, more than 12 million files? Or is that hyperbole?

I don't see how it is practical to sort through them manually in any case. That would be almost 7,000 hours of work even if you could handle one file every two seconds, which you probably couldn't.

It would help to know what there is within each file name that you want to use for sorting.

 

My first inclination would be to:

Produce a complete file list using the DOS "dir" command.

Sort the list by importing it into Excel or some similar computerized process (ME might be helpful at this stage).

Convert the sorted list into DOS "move" commands in a batch file, with the appropriate destination folder embedded in each command.

Run the batch file.

 

If you truly want to handle the files manually with help from ME, then you could write a macro that

1. clicks on the file name to highlight it (you would start with the mouse positioned over the file name in a Windows explorer screen)

2. copies the highlighted file name into the clipboard (F2 key followed by Ctrl-c)

3. generates a command.com command string to move the file to the appropriate folder, and launches command.com with the command string.

You could have several macros, identical except for the destination folder name, and launched by different hot keys. That way, you would position the mouse over the file name, hit the appropriate hot key, and the file would be zinged off to the destination folder.

Link to comment
Share on other sites

I'm not sure exactly what a hyperbole is, but the exact number of files I am working with at this time is 12156932. I need to see the thumbnails of each image to move them into their respective folders. I have made a basic move script which involves dragging the images to desired folders with about 85-90% success without the thing freezing up on me and I can process these much faster than 2 per second but the script cannot it seems. Let us say for example the image contains pics of person A only, then it is to go into folder A. The same for person B-D. But if the image contains a combination of A-D, the picture goes into folder E. Filenames are not going to be of any assistance since they are all consecutive numbers. I've been looking at thumbnails to decide which image goes into it's respective folder as mentioned before. I just wish there was a cut and paste function in ME which would allow me to define a folder on shortcut. Something like:

 

Shortcut NumPad1

Mouse Move x,x (to hover over image)

Left Click (to select)

Clipboard Cut

*Target Folder D:\Folder_A\

*Clipboard Paste

 

Shortcut NumPad2

Mouse Move x,x (to hover over image)

Left Click (to select)

Clipboard Cut

*Target Folder D:\Folder_B\

*Clipboard Paste

 

Shortcut NumPad3

Mouse Move x,x (to hover over image)

Left Click (to select)

Clipboard Cut

*Target Folder D:\Folder_C\

*Clipboard Paste

 

Shortcut NumPad4

Mouse Move x,x (to hover over image)

Left Click (to select)

Clipboard Cut

*Target Folder D:\Folder_D\

*Clipboard Paste

 

Shortcut NumPad5

Mouse Move x,x (to hover over image)

Left Click (to select)

Clipboard Cut

*Target Folder D:\Folder_E\

*Clipboard Paste

 

If I could get a working script going in ME that would not keep stalling on me or have another option available to simply run through using visuals, then I can knock these out in about 5-8 a second. That's about 45 days max. Not a problem. But before it's suggested for me to use facial recognition software, it isn't just people, it's cars, places, and many more subjects. I will share with you my makeshift script to solve the issue for the time being. Again, I'm not looking for a mod, rather a replacement if one exists. Or advice on how to achieve an alternative.

 

<MMS2:530,300><MSD:50><LDN><MMS2:20,250><MSD:50><LUP><MSD:50><MMS2:530,300>

 

Mouse Move Screen 530,300 (over image)

Delay 50 Milliseconds

Mouse Left Button Down (begin image file drag)

Mouse Move Screen 20,250 (target folder)

Delay 50 Milliseconds

Mouse Left Button Up (end image file drag)

Delay 50 Milliseconds

Mouse Move Screen 530,300 (returns to over image)

Link to comment
Share on other sites

That's a lot of photos! I have thousands but nowhere near millions of pictures.

 

Whenever I need to do file manipulation I use the file commands in Macro Express. You can copy, delete, move and rename files and it doesn't require any tricky mouse positioning within Windows Explorer.

 

You could use a free program like Irfanview to display the photo. Then you could press a key to display the next picture and move the previously displayed one to the correct folder.

 

If I were using Windows Explorer I would install the Context Menu macro. This adds a macro name to your right-click menu. You could then right-click on the picture, choose the macro, and have a choice within the macro to direct it to the correct folder. (The right-click and choosing the macro can also be done using keystrokes.)

Link to comment
Share on other sites

How about a macro that doesn't move the files but renames them? For example, if the file is destined for folder A, then the macro:

1. Clicks once on the thumbnail to highlight it.

2. Uses keyboard commands to rename it from, say, FILE12345.JPG to A_FILE12345.JPG.

3. Moves on to the next thumbnail.

 

The rename should happen pretty fast, not like waiting for the clipboard which can be slow.

 

Then once you have renamed a few hundred or a few thousand, you run a simple DOS batch script to move them:

move c:\sourcefolder\A_*.* c:\destination_A_Folder

move c:\sourcefolder\B_*.* c:\destination_B_Folder

move c:\sourcefolder\C_*.* c:\destination_C_Folder

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...