ViliamJobko Posted January 11, 2012 Posted January 11, 2012 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.
Xenobiologist Posted January 11, 2012 Posted January 11, 2012 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
Blue_Drache Posted January 11, 2012 Posted January 11, 2012 (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 January 11, 2012 by Blue_Drache Lofting the cyberwinds on teknoleather wings, I am...The Blue Drache
Mikeman27294 Posted January 11, 2012 Posted January 11, 2012 (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 January 11, 2012 by Mikeman27294
Xenobiologist Posted January 11, 2012 Posted January 11, 2012 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
Mikeman27294 Posted January 11, 2012 Posted January 11, 2012 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.
BrewManNH Posted January 11, 2012 Posted January 11, 2012 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 GudeHow 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
Mikeman27294 Posted January 11, 2012 Posted January 11, 2012 True... I thought it was an error with the comment not having any other cod before it. Thanks.
ViliamJobko Posted January 15, 2012 Author Posted January 15, 2012 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?
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