--[[ Copies DNG into missing file locations SETUP INSTRUCTIONS Copy all this quoted text into Notepad or TextEdit and save it as a text file on your desktop and call it "YOURFILENAME.lua". Now you need to create a scripts folder: In Lightroom, choose Lightroom > Preferences (Mac OS) or Edit > Preferences (Windows). Choose the Preset tab and select Show Lightroom Presets folder. Create a folder in the Lightroom folder called Scripts. Copy the "YOURFILENAME.lua" script into the Scripts folder. Quit and reopen Lightroom. You should now see a little scripts menu to the right of the Help menu. It has a single item YOURFILENAME. --]] ------------------------------DON'T CHANGE BELOW local LrPathUtils = import 'LrPathUtils' local LrFileUtils = import 'LrFileUtils' local LrTasks = import 'LrTasks' local LrDialogs = import 'LrDialogs' local SEP if MAC_ENV then SEP = '/' else SEP = '\\' end LrTasks.startAsyncTask( function() srcPath = LrPathUtils.getStandardFilePath( 'desktop' ) .. SEP .. "dummy.dng" if LrFileUtils.exists( srcPath ) ~= "file" then LrDialogs.message("Create a dng called dummy.dng and put it on your desktop", srcPath) return false end local catalog = import "LrApplication".activeCatalog() photos = catalog:getTargetPhotos() filePaths = {} for i, photo in ipairs(photos ) do if photo:checkPhotoAvailability() == false then destPath = photo:getRawMetadata('path') LrFileUtils.copy( srcPath, destPath ) end end LrDialogs.showBezel("Finished", 5) end) |