In the first hour of our March AutoHotkey webinar we covered core concepts of what to consider when writing a script.
The second hour we took a deeper dive into coding using some of the methods mentioned in hour one.
Content & Resources shared in AutoHotkey webinar
Script highlight: Copy Explorer path to clipboard
#SingleInstance, force ;AutoHotkey Webinar
#IfWinActive ahk_class CabinetWClass ;Explorer window
^+c:: ;Copy explorer path to clipboard
clipboard = ; Empty the clipboard
SendInput, ^c ;changd from Send 11/23
If ErrorLevel ;Added errorLevel checking
MsgBox, No text was sent to clipboard
;***********for UNC &DropBox*******************
IfEqual, A_UserName,joe,StringReplace,Clipboard,Clipboard,B:,C:\DropBox ;Joe
IfEqual, A_UserName,a0225522,StringReplace,Clipboard,Clipboard,E:,\\DFLFS04\email ;Joe
Things to Consider when writing a NEW script
- Are you behind a time-crunch to get the job done?
- Are you looking for a 1-time solution?
- What are the odds that you could re-purpose your solution for something else at a later date?
- Will this be run on multiple:
- Windows versions
- What software is also running on computers
- Bitness (32 & 64) of OS, AutoHotkey , program interacting with
- Is there existing code that you can borrow / steal / leverage?
- Previous code I’ve written
- Sites like: AHK Forum Stack Overflow Reddit Github the-Automator JSZApp Jack Dunning Blog
- Ask colleagues / friends / Social channels
- Will someone other than you be using / maintain the code? Program to their “level”
Many ways to “Control / Interact” Window’s programs
- Send keystrokes / MouseClicks
- File read / write(Append) / File Object
- Microsoft Active Accessibility (MSAA) – ACC viewer / ACC library
- IUI Automation interface
- COM to connect to programs / Past AHK Webinar on COM