Jump to content
Sign in to follow this  
Juzzz

check selected text

Recommended Posts

Juzzz

i want to make an script that copy text selected with your middle mouse button as a service (in the end)

i got this script now:

#include <misc.au3>

while 1
If _IsPressed(4) Then _CopyToClip()
sleep(100)
WEnd

Func _CopyToClip()
    send("^c")
    TrayTip("Middle mouse copy", "copied: " & ClipGet(), 3, 1) 
EndFunc

the problem is:

when i use this script it works also when i just want to autoscroll on web pages with my middle mouse button.

how can i first check if the text is slected?

optional:

1. i set the TrayTip to be displayed for 3 seconds.. does not work.

2. i want to run it as a service so i don't have an tray icon etc, but taskmgr says it uses 10 mb ram!?

Share this post


Link to post
Share on other sites
MagnumXL

There is better solutions but since you are non-stop copying to the clipboard while the middle mouse is down just:

If Clipget <> ""

That will return true if your Send("^c") got something.

Edited by MagnumXL

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  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.