Skip to main content

⚠️ Please note that this topic or post has been archived. The information contained here may no longer be accurate or up-to-date. ⚠️

Finding a list of missing files

Comments

5 comments

  • Eric Nepean
    [quote="NN635982792069627197UL" wrote:
    Hi

    In my current activity of consolidating aperture, Lightroom into a single capture one 10 catalog, I have yet to find out how to identify a list of 'missing photos'. In other words, I know when I find one how to locate the file but how do I produce a list of missing files across the catalog. I can't see any file location attributes on the filter or smart album.

    Thanks

    James


    I don't think there is a way through the Capture One menu system.

    This AppleScript below should do it for you.
    Open script editor, open a blank file, copy and paste the code below into it. Compile, and save.
    Open the log history window, then run the code. A list of the images with missing files appears in the log history.

    global debug, displayDialogonNotFound
    set debug to false
    set displayDialogonNotFound to false
    global maxSearchLevel

    -- I have observed that for catalogs of > 5000 -10000 images or so, while the command "get every image" is executing on the entire catalog,
    -- Capture One causes an OSX crash by requesting vast amounts of virtual RAM. (a support ticket has been raised)
    -- This crash does not happen immediately, it takes a few minutes.
    -- On my iMac, once Capture one is using 50GB of virtual RAM, (and is till growing) the only escape is to power cycle the iMac.
    -- For that reason, the default search mode is to search all the user collections, but not "All Images"

    set SearchAllImages to false -- DO NOT set to true if there are more than 5000 or so images in the catalog


    tell application "Capture One 10"
    tell document 1

    if SearchAllImages then
    set maxSearchLevel to 1
    set everyCollection to get every collection
    set countColls to count of everyCollection
    set searchLevel to 0
    set nextSearchLevel to searchLevel + 1
    if nextSearchLevel ≤ maxSearchLevel then
    repeat with c_Counter from 1 to countColls
    set searchCollName to (get name of collection c_Counter) as text
    if searchCollName = "All Images" then
    my search_collection((collection c_Counter), nextSearchLevel)
    end if
    end repeat
    end if

    else
    set maxSearchLevel to 100
    set everyCollection to get every collection
    set countColls to count of everyCollection
    if countColls = 1 then -- If there are no user collections, there is only the "All Images" collection.
    display notification "No User Collections to Search"
    error "No User Collections to Search"
    end if

    set searchLevel to 0
    set nextSearchLevel to searchLevel + 1

    if nextSearchLevel ≤ maxSearchLevel then
    repeat with c_Counter from 1 to countColls

    set searchCollName to (get name of collection c_Counter) as text
    if searchCollName ≠ "All Images" then
    my search_collection((collection c_Counter), nextSearchLevel)
    end if
    end repeat
    end if

    end if

    end tell
    end tell


    --Handlers -------------------

    on search_collection(thisCollection, searchLevel)
    -- recursive handler to search a collection and it's subcollections

    global debug
    global maxSearchLevel
    global displayDialogonNotFound

    set nextSearchLevel to searchLevel + 1

    tell application "Capture One 10"
    tell document 1
    tell thisCollection

    set thisCollName to (get name) as text
    set thisCollKind to (get kind) as text
    set subCollections to get every collection
    set everyImageList to get every image

    repeat with thisImage in everyImageList

    tell thisImage
    set imageName to (get name) as text
    set imagepath to get path
    end tell

    set file_found to "no"
    tell my application "Finder"
    if exists imagepath as POSIX file then
    set file_found to "yes"
    end if
    end tell
    if file_found = "no" then
    if displayDialogonNotFound then display dialog imageName & " not found at " & imagepath
    log imageName & " not found at " & imagepath & " in " & thisCollKind & " " & thisCollName
    end if

    end repeat

    if debug then log "Done " & thisCollKind & " " & thisCollName & " "

    if thisCollKind ≠ "project" then -- do not search collections contained inside a project to avoid repeated "hits" of the same image
    set nextSearchLevel to searchLevel + 1
    if nextSearchLevel ≤ maxSearchLevel then
    if debug then log "Searching Below " & thisCollKind & " " & thisCollName
    repeat with searchCollection in subCollections
    my search_collection(searchCollection, nextSearchLevel)
    end repeat
    end if
    end if

    end tell
    end tell
    end tell
    return
    end search_collection


    0
  • James Hardy
    Thanks Eric, I'll give it a try.
    Shame it's not part of the core product.
    0
  • Eric Nepean
    [quote="NN635982792069627197UL" wrote:
    Thanks Eric, I'll give it a try.
    Shame it's not part of the core product.

    It took me a couple of hours to research, write and test
    With a little more work, I think I can write this so it can be integrated this into the Capture One Scripts Menu (biggest required change is writing out put to a file), and then it will be as if it is part of the product.
    0
  • peter Frings
    Hi Eric,

    it's too bad you have to limit the search space because C1 is such a memory hog.

    To make sure I understand it correctly: the problem with not being to search all images is that we now can only find missing images when those are part of an album; images that are not part of an album will not be checked.

    A full check would then require a first check of which images are not part of an album so that the user can be alerted that not all images have been checked. But, that first check would probably send memory through the roof as well, so we'd back to square one. Sigh.

    But I admire you're C1 scripting skills!

    Cheers,
    Peter.
    0
  • Eric Nepean
    [quote="peter.f" wrote:
    Hi Eric,

    it's too bad you have to limit the search space because C1 is such a memory hog.

    C1 has a bug that is forcing this choice.

    To make sure I understand it correctly: the problem with not being to search all images is that we now can only find missing images when those are part of an album; images that are not part of an album will not be checked.

    More or less. "All Images" is a smart album owned by the system; it is not checked. All other collections are checked. A collection may be an Album or a smart album or a project or a group.

    A full check would then require a first check of which images are not part of an album so that the user can be alerted that not all images have been checked. But, that first check would probably send memory through the roof as well, so we'd back to square one. Sigh.

    In your shoes I would create some albums at the top level of the user collections. Do not put them inside a group or project. In All Images, select images in sets of about 5000 each, and put each set in one of these albums. Then run the tool to find images with missing files. When you are done, you can delete the albums, take care not delete the images inside.



    But I admire you're C1 scripting skills!

    Cheers,
    Peter.
    0

Post is closed for comments.