Skip to content

Instantly share code, notes, and snippets.

@nitoyon
Last active December 17, 2015 23:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nitoyon/5693725 to your computer and use it in GitHub Desktop.
Save nitoyon/5693725 to your computer and use it in GitHub Desktop.
Get selected file size and path in Lightroom (tested with https://github.com/nitoyon/lua-console-lightroom-plugin & Lightroom 4.3)
local LrApplication = import 'LrApplication'
local catalog = LrApplication.activeCatalog()
local size = 0
local pathes = ""
local photos = catalog:getMultipleSelectedOrAllPhotos()
for k,photo in ipairs(photos) do
size = size + photo:getRawMetadata("fileSize")
pathes = pathes .. "\n" .. photo:getRawMetadata("path")
end
return string.format("%.1f MB%s", size / 1024 / 1024, pathes)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment