Skip to main content
June 20, 2012
Question

No Export of Rejected Photos

  • June 20, 2012
  • 1 reply
  • 2891 views

Hi peeps,

When editing a shoot, I CTRL+[arrow down] the rubbish pics to set them as rejected. The plan is to delete them before "selecting ALL" in the shoot and exporting.

Trouble is I'm always forgetting to delete the rejects before exporting ( ARRGHH!).  So I've just written a small plugin that adds a filter to the Export Dialog which when enabled prevents any photo that is set as rejected from beign exported. Hurrah!!!  Here's the code. Feel free to use if it's useful!

info.lua

***************************************************************************************

return {

    appName = "NoExportRejected",   

    author = "Buzz Aldrin",

    LrSdkVersion = 4.0,

    LrSdkMinimumVersion = 4.0, -- minimum SDK version required by this plugin

    LrPluginName = LOC "$$$/SDK/MetaExportFilter/Sample=No Export Rejected",

    LrToolkitIdentifier = 'com.adobe.lightroom.sdk.export.norejected',

   

    LrExportFilterProvider = {

    {

        title = LOC "$$$/SDK/MetaExportFilter/Sample=Don't Export Rejected", -- the string that appears in the export filter section of the export dialog in LR

        file = 'NoRejectedOnExport.lua', -- name of the file containing the filter definition script

        id = "noRejected",  -- unique identifier for export filter

    },

   

    },

    VERSION = { major=4, minor=1, revision=0, build=831116, },

}

***************************************************************************************

NoRejectedOnExport.lua

***************************************************************************************

local LrView = import 'LrView'

local bind = LrView.bind

--------------------------------------------------------------------------------

-- This function will create the section displayed on the export dialog

-- when this filter is added to the export session.

local function sectionForFilterInDialog( f, propertyTable )

   

    return {

        title = LOC "$$$/SDK/MetaExportFilter/SectionTitle=Don't Export Rejected Photos",   

            f:row {

                spacing = f:control_spacing(),

                f:static_text {

                    title = "Don't Export Rejected Photos",

                    fill_horizontal = 1,

                },   

            }

    }

end

--------------------------------------------------------------------------------

-- This function obtains access to the photos and removes entries that don't match the metadata filter.

local function shouldRenderPhoto( exportSettings, photo )

    local shouldRender   

    local flag = photo:getRawMetadata( 'pickStatus' )

    if flag == -1 then

        shouldRender = false

    else

        shouldRender = true

    end

    return shouldRender

end

   

--------------------------------------------------------------------------------

return {

    exportPresetFields = exportPresetFields,

    startDialog = startDialog,

    sectionForFilterInDialog = sectionForFilterInDialog,

    shouldRenderPhoto = shouldRenderPhoto,

}

***************************************************************************************

This topic has been closed for replies.

1 reply

areohbee
Legend
June 20, 2012

Sweet - thanks John.

~R