LrDevelopController.getValue (key) returns nil for all the crop settings (CropLeft, CropRight, CropTop, CropBottom) immediately after a user clicks Select Subject or Sky. To reproduce:
1. Save the following script in the Scripts folder.
2. Run the script, which starts a background task calling LrDevelopController.getValue().
3. Edit a photo in Develop, open the Masking tool, and click Select Sky.
4. Observe this message displayed:
Tested on LR 11.2 / Mac OS 11.6.2.
local LrTasks = import "LrTasks"
local catalog = import "LrApplication".activeCatalog ()
local getCurrentModuleName = import "LrApplicationView".getCurrentModuleName
local getValue = import "LrDevelopController".getValue
local showBezel = import "LrDialogs".showBezel
LrTasks.startAsyncTask (function ()
while true do
local photo = catalog:getTargetPhoto ()
if photo ~= nil and getCurrentModuleName () == "develop" then
local CropLeft, CropRight, CropTop, CropBottom =
getValue ("CropLeft"), getValue ("CropRight"),
getValue ("CropTop"), getValue ("CropBottom")
if CropLeft == nil then
showBezel (string.format (
"CropLeft = %s\nCropRight = %s\nCropTop = %s\n" ..
"CropBottom = %s\n", CropLeft, CropRight, CropTop,
CropBottom), 10)
end
end
LrTasks.sleep (0.2)
end
end)