eNtoS Posted April 22, 2006 Posted April 22, 2006 i want to make a simple script that will paste text from the clipboard with an alternative shortcut the problem is that the script runs through once and exits immediately... i want it to sit and wait for my hotkey... any help is greatly appreciated HotKeySet("^+v", "parse") Func parse() HotKeySet("^+v") Send("ClipGet()") HotKeySet("^+v", "parse") EndFunc
MHz Posted April 22, 2006 Posted April 22, 2006 (edited) Welcome eNtoS, Just use a While loop with a Sleep inside it. HotKeySet("^+v", "parse") While 1 Sleep(100) WEnd Func parse() HotKeySet("^+v") Send("ClipGet()") HotKeySet("^+v", "parse") EndFunc Edit: Remove the quotes around ClipGet() if you want the contents from the clipboard instead of a string "ClipGet()". Edited April 22, 2006 by MHz
Zedna Posted April 22, 2006 Posted April 22, 2006 (edited) Opt("GUIOnEventMode",1) HotKeySet("^+v", "parse") HotKeySet("some your hotkey", "DoExit") while 1 Sleep(10) WEnd Func parse() HotKeySet("^+v") Send("ClipGet()") HotKeySet("^+v", "parse") EndFunc Func DoExit() exit EndFunc Edited April 22, 2006 by Zedna Resources UDF ResourcesEx UDF AutoIt Forum Search
eNtoS Posted April 22, 2006 Author Posted April 22, 2006 thx for the help, was exactly what is was looking for (btw, had to remove the double quotes around ClipGet() to make it work.
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