Show cursor at insertion point

Is there a way to cause DTPO to show the active flashing I-beam cursor in an rtf document using applescript? I’d like to insert a picture from the clipboard but that requires that the insertion point be active. Maybe there’s a way to do it using System Events but I haven’t figured it out.

User interface scripting might be a possibility but that’s awkward. Another possibility is to attach an image file right before the selected text like this:


tell application "DEVONthink Pro"
	set thePath to "/Users/<YourUserName>/Pictures/Demo.jpeg"
	set theFile to (thePath as POSIX file) as alias
	make new attachment with properties {file name:theFile} at before first paragraph of selected text of think window 1
end tell

Thank you thank you thank you!
I didn’t know that little trick. Fortunately, no text has to be selected to use it. The following line worked well for me….


make new attachment with properties {file name:theFile} at last paragraph

I owe you a beer! ( Don’t worry, not an American beer! :laughing: )

Oops, I should have mentioned that the line of code above is inside a ‘Tell text of think window 1’ block along with some other code.