Jump to content

How to make a key to activate a script. Sorry for asking this


 Share

Recommended Posts

I know I might be flamed for asking this, but I have search and looked in the Q&A.

I Have made some scripts and would like to activate them by a keystroke. Found something about Hotkeyset, but not sure how it works, and if it what I should be using?

HotKeySet("{F3}", "Go")

While 1

Sleep(100)

WEnd

Func Go()

AND HERE I SET ALL MY CODE IN

EndFunc

Am I missing something?

Edited by mbm
Link to comment
Share on other sites

Welcome to the forum.

It does not look like you are missing anything except to replace "AND HERE I SET ALL MY CODE IN" with some code.

When F3 is pressed, the Go function will be executed. If that is not working, let us know what it is doing wrong.

Post your code because code says more then your words can. SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y. Use Opt("MustDeclareVars", 1)[topic="84960"]Brett F's Learning To Script with AutoIt V3[/topic][topic="21048"]Valuater's AutoIt 1-2-3, Class... is now in Session[/topic]Contribution: [topic="87994"]Get SVN Rev Number[/topic], [topic="93527"]Control Handle under mouse[/topic], [topic="91966"]A Presentation using AutoIt[/topic], [topic="112756"]Log ConsoleWrite output in Scite[/topic]

Link to comment
Share on other sites

Welcome to the forum.

It does not look like you are missing anything except to replace "AND HERE I SET ALL MY CODE IN" with some code.

When F3 is pressed, the Go function will be executed. If that is not working, let us know what it is doing wrong.

ok I got the idea wrong. I though the script would execute when the F3 key was press, but the script shold be running in the background offcouse.

Tried this which worked fine. Will try with my own script later.:

HotKeySet("{F3}", "Go")

While 1

Sleep(100)

WEnd

Func Go()

MsgBox(0, "My First Script!", "Hello World!")

EndFunc

Link to comment
Share on other sites

If you want to start running your script (or any other proramm) by pressing a key (i.e. "F3"), you can create a shortcut of your script on the desktop, go to the properties of the shortcut and enter the key you want.

A-Jay

Rule #1: Always do a backup         Rule #2: Always do a backup (backup of rule #1)

Link to comment
Share on other sites

If you want to start running your script (or any other proramm) by pressing a key (i.e. "F3"), you can create a shortcut of your script on the desktop, go to the properties of the shortcut and enter the key you want.

A-Jay

Ok thanks, so no need for the Hotkey in the script then?

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...