Autohotkey: A Beginner's Move On
Autohotkey is a Superpowerful Scripting Language available at www.autohotkey.com
It's more Powerful than you can imagine.Believe me,the day I started using it I was amazed how I was using a PC in this universe without Autohotkey. I mean it's so so easy,yet so effective and fast.
By it ,you can
So Lets Start
Well the autohotkey tutorial is a good place to learn autohotkey.It comes as a fair book full of all Hotkeys and commands that you need to know.It's well structured and full of links and examples that will help you get moving. But if you want a quick guide that can increase you productivity with autohotkey in no time this is for you.You can start with creating shortcuts for opening files and documents.
!n:: ; a SEmicolon (;) is used for comment. ;Here ! stands for Alt and 'n' Is Key N run notepad.exe ;runs notepad return ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ^d:: ; ^ is ctrl run d:/my docs/mydoc.doc return
You can also use Autohotkey as a Text Expander
::btw::by the way ;This expands Btw to "by the way" when followed by a Space,comma or semicolon.
;Also you can use "Send" command to create hotstrings. !n:: run notepad.exe Winwait, ahk_class Notepad ;Winwait waits for the Specified window to appear. Send Hi, There ;Here Alt + n runs notepad and waits for it. When the window opens it prsses or Writes Hi, There return
Use #Ifwinactive command to make same hotkeys perform different functions in different windows.
#IfWinActive ahk_class CabinetWClass ;Cabinetwclass is class name for windows explorer ;Use "WINDOWS SPY" utility in Autohotkey Pacakage for getting class name for different windows. { !n:: run notepad.exe return } #IfWinActive ahk_class notepad ; ahk_class notepad is notepad window { !n:: run d:/mydoc.doc return }
You can Remap Keys...
End::T ;This will make End Key behave as "T" [HArdly any one uses End] Home::A F11::SpaceRemapping may not work in certain games and applications & keys might go back to their original functions.
Perform same Tasks again and again ..
Loop 1 { Send {Down} Sleep, 1000 ;Sleep is used to delay execution.Here 1000 denotes time in ms. 1000 ms = 1 sec } ;The down key will be pressed 100 times !a:: Exitapp ;Here Alt + a when pressed will exit the script conatining the loop and Scrollong Down (here) will Stop. return
You can increase that 100 to as much as you like.
Use an Exitapp command as above to end scripts when you like.
Tips::
- Have a look at the given Autohotkey manual.It is your utlimate guide into the world of Autohotkey.
- If you use Autohotkey and create custom scripts,it is advisable that you create a single script and not many scripts for each function.This is because it is seen that a standard Ahk Script consumes some 6mb's of Ram or close to 6mb's when it runs,Also the size of a script has minimal impact on Ram.So if you run 4 scripts for 4 functions or so they will cost you 6 X 4 = 24 mbs of RAM.So it is highly recommended to have a SINGLE Master Script.
- Download Scite for Autohotkey -- A Gui IDE for Autohotkey.
- Always add an EXITAPP command to your Script.
- Always end a Hotkey declaration with" Return".
- Use { .... } to specify regions of #Ifwinactive and other condition based commands
- Go here to see Some of my special AHK Scripts which I am SuperSure you will enjoy.
No comments:
Post a Comment