Sign in to follow this  
Followers 0
atomman

Paste and select pasted text

8 posts in this topic

Having trouble figuring out how to automatically select (highlight) text pasted from the clipboard.

I'm aware of 'MouseClickDrag', but i don't think that's what i want to use. And since the text could be multiple lines, i don't think 'Send ("{left 3}") at the caret position is an option.

Searched the forums and referred to the help manual, but this one has me stumped.

Share this post


Link to post
Share on other sites



In User Defined Functions:

Selects a range of characters in an edit control.

#Include <GuiEdit.au3>

_GUICtrlEditSetSel ( $h_edit, $i_start, $i_end )

Share this post


Link to post
Share on other sites

thanks! i'll twiddle with that and see what i can do

Share this post


Link to post
Share on other sites

Still lost on this one. I don't think i explained the problem correctly either. What i want to do:

Select some text in a 3rd party application (ex: web browser) (no problem here)

Copy it (no problem here)

Switch to another 3rd party app (ex: notepad) (no problem here)

Paste the text (no problem here)

Push button on the AutoIt GUI and select the text just pasted -- and this is where i'm stuck. I need to select the text without having to know the x, y coordinates (since they will change every time the operation is done).

Been playing with 'GUICtrlSetData', 'ClipGet', '_GUICtrlEditSetSel', 'ControlCommand', '_GUICtrlEditGetSel' and a few other functions.

Share this post


Link to post
Share on other sites

might be tough depending on the 3rd party app you are pasting to...what are you going to use the data for once you have it? can't you just use what's laready in the clipboard agian?

Share this post


Link to post
Share on other sites

the 3rd party app is KompoZer (unofficial Mozilla NVU bugfix).

what i want to do is select the pasted text and apply a CSS style. applying the style is no problem, but selecting the text pasted from the clipboard seems to be :)

another possible option may be to manipulate the text in the clipboard directly, if that's even possible. and yet another option might be to paste the text in a disabled, hidden window (like an edit box? or whatever), manipulate it and then paste it to KompoZer.

Share this post


Link to post
Share on other sites

#7 ·  Posted (edited)

you can use clipget() to grab the text in the clipboard. You should be able to do most string manipulations easy once you have it.

Edited by evilertoaster

Share this post


Link to post
Share on other sites

thanks toaster

i took another approach by inserting the text into the KompoZer "insert HTML" edit window and that works very well.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0