| View previous topic :: View next topic |
| Author |
Message |
mighty-f
Joined: 12 Sep 2005 Posts: 213
|
Posted: Sat Feb 24, 2007 2:55 am Post subject: automatically copy the selected text |
|
|
I want to copy some text automatically when the selected test is leftmouse released.
for example, for the following sentence:---
The trial in the murder case is all set to begin from tomorrow
I select the whole sentence and then when i reach at the end of "tomorrow",
i release the left mouse button . I want a script such that the selected portion is automatically copied to the clipboard when i release the left mouse button.
Any script for this?  |
|
| Back to top |
|
 |
Laszlo
Joined: 14 Feb 2005 Posts: 4015 Location: Pittsburgh
|
Posted: Sat Feb 24, 2007 3:14 am Post subject: |
|
|
| here |
|
| Back to top |
|
 |
mighty-f
Joined: 12 Sep 2005 Posts: 213
|
Posted: Sat Feb 24, 2007 3:58 am Post subject: |
|
|
Hi I read that post and found it hard to realize.
Can you simply a bit? |
|
| Back to top |
|
 |
Laszlo
Joined: 14 Feb 2005 Posts: 4015 Location: Pittsburgh
|
Posted: Sat Feb 24, 2007 4:13 am Post subject: |
|
|
| Code: | ~LButton::
MouseGetPos x0, y0 ; save start mouse position
KeyWait LButton
MouseGetPos x, y ; position when button released
If (abs(x-x0) > 5 or abs(y-y0) > 5) {
clip0 := ClipBoardAll ; save old clipboard
ClipBoard =
Send ^c ; selection -> clipboard
ClipWait 2, 1 ; restore clipboard if no data
If ErrorLevel
ClipBoard := clip0
}
Return |
|
|
| Back to top |
|
 |
Candle
Joined: 19 Aug 2004 Posts: 334
|
Posted: Sat Feb 24, 2007 7:45 am Post subject: |
|
|
Nice Laszlo. _________________ Autohotkey Just drives me crazy .. |
|
| Back to top |
|
 |
|