Page 1 of 1

Left mouse click to copy and paste script

Posted: 03 May 2017, 14:24
by 3rror403
Hi all,

I've been working on transferring test cases from one system to another. In each of these systems, there are text fields which need to be copied and autohotkey has helped me out greatly to simplify my task so I wanted to share what I've been using. I'm not claiming this is the best solution but it's saved me tons of time. This script is enabled/disabled using the Tab button. While enabled, a single left mouse click will highlight all text contained in a field and then copy it to the clipboard. A second left mouse click will paste the clipboard into a new empty field. Because of this, this script only functions correctly when pasting the clipboard into an empty field, because if text did exist in the target field, it would end up copying the target field text instead. Hopefully this will help someone else down the road.

Code: Select all

Tab::Suspend, Toggle

~LButton::
Click 3
KeyWait, LButton
Send ^c
~RButton::
KeyWait, LButton
Send ^v

Re: Left mouse click to copy and paste script

Posted: 03 Jul 2018, 23:14
by rosid
thanks mate!