Script to take selected number amount and add to "Price" metadata

This script worked:

tell application id "DNtp"
	set theRecord to content record
	try
		set theSelectedText to selected text of think window 1 & "" as string
	on error
		error "Please select some text"
	end try
	add custom meta data theSelectedText for "Price" to theRecord
end tell

I got it from this thread on “Get the currently selected text”: