Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Trying to persist a dialog value using LrPrefs

Engaged ,
Aug 06, 2025 Aug 06, 2025

I'm trying to set up a simple dialog with an edit field the value of which persists using the code below, called using  LrPluginInfoProvider in my info file. What am I doing wrong?

local LrView = import "LrView"
local LrPrefs = import "LrPrefs"
local LrDialogs = import "LrDialogs"
local bind = LrView.bind
local pluginInfoProvider = {}

function pluginInfoProvider.sectionsForTopOfDialog(f, properties )
	local prefs = LrPrefs.prefsForPlugin( )    
	if properties.userName == nil then
		properties.userName = prefs.userName or "yyyy"
	end

	return {
		{
			title = "Chatter Preferences --",
			synopsis = "Chatter, by Kim Aldis",

			f:row {
				f:column {
					spacing = f:control_spacing(),
					f:static_text {
						title = "Testing:"
					},
					f:edit_field {
						value =  bind "userName",
						width = 300
					}

				}
			}
		}
	}
end

return pluginInfoProvider
TOPICS
macOS , SDK
104
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

LEGEND , Aug 06, 2025 Aug 06, 2025

I think you may need to set the "bind_to_object" property of the returned controls:

 

f:row {bind_to_object = properties,
    f:column {
        spacing = f:control_spacing(),
        ...

 

Translate
LEGEND ,
Aug 06, 2025 Aug 06, 2025

I think you may need to set the "bind_to_object" property of the returned controls:

 

f:row {bind_to_object = properties,
    f:column {
        spacing = f:control_spacing(),
        ...

 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Aug 06, 2025 Aug 06, 2025
LATEST

And as if by magic ...

 

Thanks John.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines