Search and select placeholder in a Devonthink Document

Hello,

i’d like to search for a placeholder (<—> or something else ) in a Devonthink document without the searchwindow.
If a placeholder was found, it should be selected and have focus, so i can overwrite it.
It would be nice, if the script can search for ← username ->, ← login ->, etc.

The document is created from a template, which contains the placeholder.

I was trying this by myself, but my script doesn’t work well
If i run the script from Script Editor, it works like it should but if i run it from DT with a shortcut it only works once.

set the_text to "<--->"
-- <---> placeholder in document
tell application "DEVONthink Pro"
	activate
end tell
tell application "System Events"
	tell process "DEVONthink Pro"
                -- open search window
		keystroke "f" using command down 
                -- insert placeholder
		keystroke the_text
                -- simulate return 
		key code 36
                -- close window
		keystroke "w" using command down
		
	end tell
	
end tell

I hope someone could help me with this script.

Thank you