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

How to get the value of edit_field

Explorer ,
Jan 25, 2024 Jan 25, 2024

Copy link to clipboard

Copied

I'm new to creating plug-ins in Lua.

So far i'm using this forum and the Adobe SDK to write my code. 

 

At the moment i'm stuck to get the value back of the edit_field.

My code

 

function ShowDialog()
	LrFunctionContext.callWithContext ("test", function (context)
		local f = LrView.osFactory ()
		local p = LrBinding.makePropertyTable (context)
		p.SourceDir = ""
		local res = LrDialogs.presentModalDialog {
			title = "Set Source directory",
			contents = f:row {
				bind_to_object = p,
				f:static_text {
					title = "Path:",
					alignment = "left",
					width = LrView.share "label_width", 
				}, 
				f:edit_field {
					alignment = 'left', place_horizontal = 0,
					width_in_chars = 50, immediate = true, 
					value = bind "SourceDir"
				},  
			},
			actionVerb = "Save",
		}
	end)
end	
	
		
	
	gij = ShowDialog()

 

 
 
TOPICS
SDK

Views

61

Translate

Translate

Report

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
Explorer ,
Jan 25, 2024 Jan 25, 2024

Copy link to clipboard

Copied

Solved:

function ShowDialog()
	logger:trace("Dialog box for new config file")
	LrFunctionContext.callWithContext ("test", function (context)
		local f = LrView.osFactory ()
		local properties = LrBinding.makePropertyTable (context)
		properties.SourceDir = ""
		local res = LrDialogs.presentModalDialog {
			title = "Set Source directory",
			contents = f:row {
				bind_to_object = properties,
				f:static_text {
					title = "Path:",
					alignment = "left",
					width = LrView.share "label_width", 
				}, 
				f:edit_field {
					alignment = 'left', place_horizontal = 0,
					width_in_chars = 50, immediate = true, 
					value = bind "SourceDir"
				},
			},
			actionVerb = "Save",
		}
		if res == 'ok' then  LrDialogs.message( properties.SourceDir ) end
	end)
end	

Votes

Translate

Translate

Report

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
Explorer ,
Jan 25, 2024 Jan 25, 2024

Copy link to clipboard

Copied

LATEST

I must say that the documentation of Adobe SDK is not quite good.
If you use the examples, they don't work always (yes I have removed the comments)

So it makes it quite difficult to learn this.

Votes

Translate

Translate

Report

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