Paris

by Jon

submit your photo


Hall of Fame
View past winners from this year

Please participate in Meta
and help us grow.

Take the 2-minute tour ×
Photography Stack Exchange is a question and answer site for professional, enthusiast and amateur photographers. It's 100% free, no registration required.

I have a list of photo filenames that I uploaded to Flickr before I got Lightroom, in this format:

P2000518.jpg
P2000549.jpg
P2000577.jpg
[etc.]

and I wondered: is there a way to tell Lightroom to import such a list and use it as a collection? (I've already imported all of my photos to Lightroom)

Or do I have to add the photos to a collection manually? (I've done some heavy hacking to read data from the sqlite database of Lightroom, but I don't dare modify the database myself)

share|improve this question

3 Answers 3

up vote 5 down vote accepted

Yes, you can create a Smart Collection for these images. The process is no difficult but could take a little time to complete.

Lightroom's Smart Collections exported definitions are simple text files. They are not difficult to dissect and recreate at all. Based on your description I would create a Smart Collection in Lightroom with the selection being that the filename contains "p2000518.jpg" or "p2000549.jpg" after that you could export the Smart Collection settings and open the resulting .smcol file in a text editor. It will likely look like this:

s = {
    id = "15D46923-B382-4322-A3B9-19347EBF7080",
    internalName = "File Name Selection",
    title = "File Named",
    type = "LibrarySmartCollection",
    value = {
        {
            criteria = "filename",
            operation = "any",
            value = "p2000518.jpg",
            value2 = "",
        },
        {
            criteria = "filename",
            operation = "any",
            value = "p2000549.jpg",
            value2 = "",
        },
        combine = "union",
    },
    version = 0,
}

You can then continue the pattern using copy and paste or a mail merge in your word processing program. I also delete the ID number and when it reimports it worked file. I created 132 rules to do smart collections by month for the past decade and it worked no problem. Since you said you had already gone into the SQL database I figure this idea should make sense. If you need more information let me know and I can flush it out more.

share|improve this answer
    
Thanks! Worked like a charm!!! I use jsdb (jsdb.org) as my swiss-army-knife for computing, and I was able to write template lines to autogenerate the smart collection file. Then I imported it into Lightroom, and the photos appeared. Then I dragged them all into a regular collection. –  Jason S Jan 2 '11 at 23:19
    
I'm still curious as to why you needed to create a smart collection by hand, instead of just matching the beginning of the filename... –  sebastien.b Jan 3 '11 at 2:00
    
I made an assumption that you wanted to import the list, but yes you could write the rule to be starting with "XXXXX" or contains "XXXX" Glad it worked for you –  Bradford Benn Jan 7 '11 at 17:52
    
Based on Bradford Benn's answer above, I created a tutorial in gist form, complete with Ruby script and a screencast. Hope it helps someone: gist.github.com/dergachev/6541450 –  Dergachev Sep 12 '13 at 18:11

I'd probably import the pictures manually and then create a set from the 'Latest import'-collection. Less hacking means less risk of shrewing up :)

share|improve this answer

I'm not sure I understand. You say you want Lightroom to import a list, but you also say you already imported the photos?

Assuming you have imported all your photos in Lightroom, and what you are trying to do is create a collection of photos that all start with P2000 (followed by 3 digits and .jpg), did you try creating a simple smart collection? The first and only rule of that smart collection would be "Filename", the action "Starts with", and the parameter "P2000". Am I missing something?

Or if they have been just recently imported, you have all of them in the Catalog section in the left panel in Library Mode, under "Previous Import". Create another collection, say "Foo", right-click, select "Set as Target Collection", then go to "Previous Import", select all, right click and select "Add to Target Collection".

share|improve this answer
    
because I have 4000+ pictures so far in Lightroom and I want a particular set of 139 of them to be marked as being in a collection, where exact set of 139 matches the collection I uploaded to my flickr webpage before I started using Lightroom. –  Jason S Jan 3 '11 at 3:09
    
The ones I don't want put in that collection are not distinguishable from the ones that are by any other way than filename (or by me looking at the photos). –  Jason S Jan 3 '11 at 3:11

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.