Search using a plain text list?

Discussion in 'Mac Apps and Mac App Store' started by noty, Apr 1, 2008.

  1. noty macrumors member


    Sep 7, 2005
    I have quite a tedious task ahead of me at work and I'm wondering if there is an app that would make it easier.

    I have a list of just over 500 images I need to find on a networked drive. Each image is named an 8 digit filename. Is there any app that could read the list and returned results without me having to enter each image number individually? Also, the list is not a spreadsheet but plain text, they are in no particular order and I am using Tiger.

    Here is an example of what the list looks like

    Any help would be appreciated, thanks.
  2. Doctor Q Administrator

    Doctor Q

    Staff Member

    Sep 19, 2002
    Los Angeles
    What do you mean by "find"? For example, what do want to do with the image named 12345678 when you find it? What's the end result of what you are doing?
  3. noty thread starter macrumors member


    Sep 7, 2005
    I want copies of all the images in one folder.

    The drive that I am searching contains thousands of images. So I want to find these 500 images and copy them into a separate folder.
  4. karenflower macrumors 6502a


    Dec 7, 2007
    You should be able to use an Applescript to help with this - I'm very much a noob but this seems to work for me:

    	set theSource to (choose folder with prompt "Choose a source.")
    	set theDestination to (choose folder with prompt "Choose a destination.")
    	set textFile to (choose file with prompt "Choose a text file." without invisibles)
    	tell application "TextEdit"
    		open textFile
    		set fileNames to every paragraph of (read textFile as string)
    		close document 1
    	end tell
    	tell application "Finder"
    		duplicate (every item whose name is in fileNames) of theSource to theDestination
    	end tell
    on error theError
    	display dialog theError buttons {"OK"} default button 1
    end try
    If you open Script Editor (in Applications/Applescript/) and paste in the code, click Run, it will display pop-up boxes for the source (where your files are located), the destination (where you want to copy them) and the text file that contains your list.

    All being well, it should copy them straight into your desired folder - however, it does require any hidden extensions such as .jpg be included in the list of names. If you need to do this and they're all the same type, you can use BBEdit's Find and Replace tool to add it to every line - type \r in the search field and .jpg\r (for example) in the replace field, and click replace all.

    It's certainly not the most elegant of solutions, I'm sure somebody will be able to point you to something better if doesn't work out. :)
  5. noty thread starter macrumors member


    Sep 7, 2005


    Thanks so much for your help. You just saved me hours of work this week. I tried the script with some test images on my home computer and it worked great. I'm surprised I haven't been able to find an app that does this. I have to do this type of thing at least 3 times a month but with a lot fewer images.

    Thanks again.
  6. karenflower macrumors 6502a


    Dec 7, 2007

Share This Page