atomman Posted September 17, 2007 Posted September 17, 2007 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.
weaponx Posted September 17, 2007 Posted September 17, 2007 In User Defined Functions: Selects a range of characters in an edit control. #Include <GuiEdit.au3> _GUICtrlEditSetSel ( $h_edit, $i_start, $i_end )
atomman Posted September 17, 2007 Author Posted September 17, 2007 thanks! i'll twiddle with that and see what i can do
atomman Posted September 17, 2007 Author Posted September 17, 2007 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.
evilertoaster Posted September 17, 2007 Posted September 17, 2007 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?
atomman Posted September 18, 2007 Author Posted September 18, 2007 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.
evilertoaster Posted September 18, 2007 Posted September 18, 2007 (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 September 18, 2007 by evilertoaster
atomman Posted September 19, 2007 Author Posted September 19, 2007 thanks toaster i took another approach by inserting the text into the KompoZer "insert HTML" edit window and that works very well.
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now