Sign in to follow this  
Followers 0
eNtoS

Keep A Script Running

4 posts in this topic

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

Share this post


Link to post
Share on other sites



#2 ·  Posted (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 by MHz

Share this post


Link to post
Share on other sites

#3 ·  Posted (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 by Zedna

Share this post


Link to post
Share on other sites

thx for the help, was exactly what is was looking for (btw, had to remove the double quotes around ClipGet() to make it work.

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