Sign in to follow this  
Followers 0
ViliamJobko

Wait until user past

9 posts in this topic

Hello,

is there any way to make my script wait until user paste the content of clip? (We can assume that Clip contains string).

My ideas of solving this problem was:

1. HotKeySet("!v") - this works just for CTRL+V key; does not work for Right Click --> Paste.

2. WinWait("", ClipGet()) - does not work for many programs including MS Word or Firefox.

Thanks in advance.

Share this post


Link to post
Share on other sites



Hmmh, I do not know how to achieve that.

You can hook the keyboard change to notice a change in there but hooking the paste of clipboard. Sorry.


Scripts & functions Organize Includes Let Scite organize the include files

Yahtzee The game "Yahtzee" (Kniffel, DiceLion)

LoginWrapper Secure scripts by adding a query (authentication)

_RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...)

Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc.

MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

What are you trying to sniff out? A password? I know some users type complicated passwords plaintext in a field like word or the run-box. Then scoop it into the clipboard and paste it into a password field. (I do, so why shouldn't others?) I realize this is bad form, but that'd be really the only reason one would want to sniff the clipboard, that I can think of.

Edited by Blue_Drache

Lofting the cyberwinds on teknoleather wings, I am...The Blue Drache

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

Yes you can - Like so:

HotKeySet("^v", "_Paste")
Func _Paste()
    Send("+{INS}");Same as CTRL+V
    ;THE USER HAS NOW PASTED. RUN THE FUNCTION YOU NEEDED HERE OR DO WHATEVER YOU NEEDED.
EndFunc

And dont be foled by the syntax highlighting above. Paste it into scite and you will see the the endfunc is not part of the 1 line comment.

Also, this doesn't work if the user used shift insert to paste, or if they used right click and paste.

Edited by Mikeman27294

Share this post


Link to post
Share on other sites

Yes you can - Like so:

HotKeySet("^v", "_Paste")
Func _Paste()
    Send("+{INS});Same as CTRL+V
    ;THE USER HAS NOW PASTED. RUN THE FUNCTION YOU NEEDED HERE OR DO WHATEVER YOU NEEDED.
EndFunc

And dont be foled by the syntax highlighting above. Paste it into scite and you will see the the endfunc is not part of the 1 line comment.

That won't help if you use right mouse --> paste.

Scripts & functions Organize Includes Let Scite organize the include files

Yahtzee The game "Yahtzee" (Kniffel, DiceLion)

LoginWrapper Secure scripts by adding a query (authentication)

_RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...)

Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc.

MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times

Share this post


Link to post
Share on other sites

So I edited into my post about the time you posted. It will help for Ctrl+V though so atleast it is something. I dont presume that windows would create a message when that happens either though.

Share this post


Link to post
Share on other sites

BTW, you're missing a quotation mark in the Send command, that's why everything looks like a comment/string in the posted code.


If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Share this post


Link to post
Share on other sites

True... I thought it was an error with the comment not having any other cod before it. Thanks.

Share this post


Link to post
Share on other sites

What are you trying to sniff out? A password? I know some users type complicated passwords plaintext in a field like word or the run-box. Then scoop it into the clipboard and paste it into a password field. (I do, so why shouldn't others?) I realize this is bad form, but that'd be really the only reason one would want to sniff the clipboard, that I can think of.

No, there are more effective ways doing what you described (Saving content of clip which is shorter than 12 characters; using keylogger etc.).

Thanks Mikeman27294 and others, but I have tried HotKeySet() before.

Isn't there some way how Windows can notify another software about Clip pasting? Maybe some DLL?

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