How can I make AutoHotKey delete text in a web field?

5

1

I've seen a lot of info (here & elsewhere) about things you can get AutoHotkey to do with text once the user has selected it, but is there a way to have an AHK script select the text itself?

I'm writing a script to enter text into web form fields, and I need the script to select any text that's already in the field & delete it.

I've looked at ControlGet but that seems to only work in dialog boxes where you can get the name of the control, which means it doesn't work for web fields. Any ideas?

David

Posted 2010-01-21T21:49:22.680

Reputation:

If you know the X Y position, you can triple click the field with MouseClick to select all text. MouseClick, left, X, Y, 3.

– Stevoisiak – 2017-09-20T17:57:22.133

Answers

5

Why not just send Ctrl+A, Del?

That is, Send ^a, {Del}, in AutoHotkey.

Blorgbeard is out

Posted 2010-01-21T21:49:22.680

Reputation: 2 565

1"!a" is Shift+a. Ctrl+a is "^a". – Snark – 2010-01-28T21:38:42.007

Why not just send Ctrl+A, Del? Because the question was about Windows XP and XP edit controls did not support Ctrl+A. – Synetech – 2015-11-28T21:02:33.473

What is the comma for? Wouldn't Send ^a{Delete} or Send ^a{Del} work equally well? – Stevoisiak – 2017-09-20T18:20:54.460

It's been a while, but I think Send ^a{Del} would press all three keys simultaneously, while Send ^a, {Del} would press Control+A, release, then press Del (and release). – Blorgbeard is out – 2017-09-20T19:38:03.523