Jump to content

Starting a script with a hotkey?


pezo89
 Share

Recommended Posts

  • Developers

sure...put a shortcut to the compiled script on your desktop and assign a "ShortCut Key" to it.

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

  • Developers

Another approach...

Welcome to the Forums!

Look up "HotKeySet" in the help file

8)

Think the OP want to start a script and this would require a script to run already. :o

@Jos

Could it be possible to make HotKeySet wich key selected works in others apps ?

For example you have :

HotKeySet("s","_none")

Func _none()
;nothing
EndFunc

While 1
WEnd

for me "s" key doesnt work in notepad... :)

Cheers, FireFox.

Maybe I am not understanding you correctly but isn;t that what you scripted?

Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

@Valuater

... its an example :) just read my problem :o

Edit : @Jos

I mean that after launch script when i go to write something in other apps like notepad, the specified key doesnt work (in my example s key)

Cheers, FireFox.

Edited by FireFox
Link to comment
Share on other sites

why dont you make a script that runs on startup and have specific hotkeys assigned to it then which hotkey is pressed call that funcition... like you want the .au3 script to run when you hit F5(for example) why dont you make it so the script IS ALREADY running but when you hit f5 it calls th funtions that you want that script to perfrom do you comprehend?

Link to comment
Share on other sites

sure...put a shortcut to the compiled script on your desktop and assign a "ShortCut Key" to it.

Or if you really want to be brave, you can:

use an au3 file (not compiled)

put that file anywhere on your hard drive that you wish

[well - maybe not the recycle bin :-]

copy the file

paste a shortcut to your desktop

[or somewhere in the start menu folder structure]

right click on that shortcut

select properties from the OS context menu

type one letter into the field named 'Shortcut key"

[for example the letter s]

When you want to start that au3 file/script...

...press ctrl-alt-s

I said brave because using an au3 file instead of a compiled script means that someday, you might update AutoIt to a new version and find that your au3 file no longer works as it had before.

Also, if you decide not to put the shortcut to the au3 file on you desktop, you might have to reboot the computer to get it to register the OS 'Shortcut key", especially if the shortcut that you paste is nested several folders deep in the start folder structure. But putting them all in one place in the start folder structure can keep some clutter off of the desktop.

[size="1"][font="Arial"].[u].[/u][/font][/size]

Link to comment
Share on other sites

... I mean that after launch script when i go to write something in other apps like notepad, the specified key doesnt work (in my example s key) ...

Why is this a surprise to you?

From the help file under HotKeySet:

When you set a hotkey, AutoIt captures the key-press and does not pass it on to the active application, with one exception: the Lock keys (NumLock, CapsLock, and ScrollLock) still toggle their respective state!

[size="1"][font="Arial"].[u].[/u][/font][/size]

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