PluginInit.lua (original) PluginInit.lua (modified) ------------------------------------------------------------------------------------------------------------------------ ... 41 function auxImportFile(catalog, fileToImport, fileToStackWith, fastImport) 42 local photoAdded = nil ======= !> -- BEGIN PL5 added code to add processed image to current collection !> local activeSourceIsCollection = false !> local activeSources = catalog:getActiveSources() !> activeSource = activeSources[1] !> if (type(activeSource) == "table") and (activeSource:type() == "LrCollection") then !> LrTasks.startAsyncTask( !> function() !> activeSourceIsCollection = not activeSource:isSmartCollection() !> end) !> end !> -- END PL5 added code ======= 43 if nil ~= fileToImport then ... 55 if nil ~= fileToStackWith then ======= !> --[[ BEGIN PL5 replace code to stack photo above source (and not below, which is PL's default) ======= 56 photoAdded = catalog:addPhoto(fileToImport, photoToStackWith) ======= !> --]] !> photoAdded = catalog:addPhoto(fileToImport, photoToStackWith, "above") !> -- END PL5 ======= 57 if nil ~= photoAdded then ... 67 logger:trace("Photo not added without stacking: " .. fileToImport) ======= !> -- BEGIN PL5 added code to add processed image also to current collection !> end !> end !> if nil ~= photoAdded then !> if activeSourceIsCollection then !> activeSource:addPhotos( { photoAdded } ) !> -- END PL5 ======= 68 end ... 144 until(nil == lineTo) ======= !> --[[ BEGIN PL5 remove code to create "DxO" collection and add the photo ======= 145 if #importedPhotos > 0 then 146 addPhotosToNewCollection(catalog, importedPhotos) 147 catalog:setSelectedPhotos(importedPhotos[1], importedPhotos) 148 end ======= !> --]] ======= 149 LrFileUtils.delete(fileName)