Deleting selection

I have a script that searches for a specific

in a web page (in BBEdit) using ‘find’ and having found it and selected it, I want to delete it.

I have tried

delete selection
set selection to “”

They have worked at some time but won’t now.

Does ‘the selection’ not refer to the selected text?

What am I missing

TIA

Is BBEdit similar to TextWrangler’s ‘selection’.

BTW, I just got the selected text in TextWrangler.

Apparently, I should have addressed it as

set the text of selection to “”

Hi joeg,

You cannot delete text from web pages. Not sure what you’re trying to do.

Edited: wait, I think I know what you’re trying to do.

gl,
kel

Hi joeg,

This worked for me and I’ll try to run it a few more times:

tell application "TextWrangler"
	activate
	delay 3
	delete selection
end tell

Intermittent problems are the hardest to solve.

Edited: btw, if that works all the time, then try going down to ‘delay .2’.

gl,
kel