deleting text from a document

I have many rich text documents whose contents came from web pages. I am trying to write a script to clean them up, which involves deleting a bunch of text. With the following script …


tell application "DEVONthink Pro"
	delete paragraph 5 of text of think window 1
end tell

``` ... I get the error "DEVONthink Pro got an error: Some parameter is missing for delete." I figure things are getting confused with the "delete record" command because it is listed in the dictionary as just "delete." Still haven't figured out how to get it to work though.

Does anyone know how to delete text from a rich text document using AppleScript? Thanks.

Here’s a possible workaround:


tell application "DEVONthink Pro"
	tell text of think window 1
		set paragraph 1 to ""
	end tell
end tell

Huh, I didn’t even try that because I figured it would leave an empty line.

Glad you suggested it because it works like a charm. Thanks. :slight_smile: