Jump to content

Running AU3 script from Keystroke


Recommended Posts

You could run a script in the background with HotKeySet() to activate a function or call another script.

:idea:

P.S. You can also set a hot key in Windows via the properties of a shortcut. See FileCreateShortcut() in the help file.

Edited by PsaltyDS
Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
Link to comment
Share on other sites

You could run a script in the background with HotKeySet() to activate a function or call another script.

:idea:

I am completely new to the AU3. Is there an example of doing this? I will take a gander at some examples. In the forums.

thanks for the quick response.

:)

-ploxy

Link to comment
Share on other sites

I am completely new to the AU3. Is there an example of doing this? I will take a gander at some examples. In the forums.

thanks for the quick response.

:idea:

-ploxy

HotKeySet("{F1}","MyFunction")

While 1
    Sleep(2000)
WEnd

Func MyFunction()
    ; Some Functions
    
EndFunc

However, the script must already be loaded, but once F1 is pressed it will load that function.

Link to comment
Share on other sites

Okay so I tried some tinkering.

And now I am getting an error that says I am missing an EndFunc for _WinWaitActivate($title,$text,$timeout=0)

HotKeySet("{a}{v}{p}","MyFunction")

While 1
    Sleep(2000)
WEnd

Func MyFunction()

Opt("WinWaitDelay",100)
Opt("WinDetectHiddenText",1)
Opt("MouseCoordMode",0)

_WinWaitActivate("TradeStation 8.7 - Untitled Desktop: 1 - Untitled Workspace:  1","TradeStation RadarSc")
Send("{ALTDOWN}{TAB}{TAB}{ALTUP}")
_WinWaitActivate("Microsoft Excel - Book1","Status Bar")
MouseMove(46,249)
MouseDown("left")
MouseMove(40,449)
MouseUp("left")
Send("{CTRLDOWN}c{CTRLUP}{ALTDOWN}{TAB}{ALTUP}")
_WinWaitActivate("TradeStation 8.7 - Untitled Desktop: 1 - Untitled Workspace:  1","TradeStation RadarSc")
Send("{CTRLDOWN}v{CTRLUP}{ALTDOWN}{ALTUP}")

Func _WinWaitActivate($title,$text,$timeout=0)
    WinWait($title,$text,$timeout)
    If Not WinActive($title,$text) Then WinActivate($title,$text)
    WinWaitActive($title,$text,$timeout)
EndFunc
EndFunc

any thoughts on what I am doing wrong?

-Ploxy

Edited by ploylitarynode
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...