Office Automation

AutoHotkey Webinar- Working session demonstrating ways to automate programs

AutoHotkey webinar– Working Session

This webinar was mostly working sessions and not a lot of resources.  It is a follow-up to our last webinar which discussed many different ways to automate windows programs using AutoHotkey.  Please the resources on this page, and watch the videos, if you want to review in depth.  We had links to the various tools that were used in the below webinar.

Script highlight: Use Google to Search for help

Thanks for attending the AutoHotkey webinar!  If you’re not currently registered for future ones, you can do so here

Office Automation

AutoHotkey Webinar- Various ways to use AHK to automate tasks in Windows

In the first hour of our March AutoHotkey webinar we covered core concepts of what to consider when writing a script.AutoHotkey webinar

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

Things to Consider when writing a NEW script

  1. Are you behind a time-crunch to get the job done?
  2. Are you looking for a 1-time solution?
    1. What are the odds that you could re-purpose your solution for something else at a later date?
  3. Will this be run on multiple:
    1. Computers
    2. Windows versions
    3. Users
    4. What software is also running on computers
    5. Bitness (32 & 64) of OS, AutoHotkey , program interacting with
  4. Is there existing code that you can borrow / steal / leverage?
    1. Previous code I’ve written
    2. Sites like:  AHK Forum  Stack Overflow  Reddit  Github  the-Automator  JSZApp  Jack Dunning Blog
    3. Ask colleagues / friends / Social channels
      1. AHK Forum   StackOverflow    Reddit
      2. LinkedIn 1  LinkedIn 2
      3. Facebook 1  Facebook2  Facebook 3
      4. Joe Glines  Jackie Sztuk  Hellbent  ahkTuts AboutScript  Chunjee  AHK vids
  5. Will someone other than you be using / maintain the code? Program to their “level”

Many ways to “Control / Interact” Window’s programs

Example Scripts used during Coding demonstration of AutoHotkey webinar

Office Automation

Understanding AutoHotkey GUI control flow with SciTE debug

AutoHotkey GUI control flowI’m working through this playlist of great mini-tutorials of AutoHotkey GUIs by Helbent/CivReborn  and was having a tough time understanding how / when events would be activated in my script.  I realized using SciTE’s debug feature would help me understand the AutoHotkey GUI control flow.  It was very helpful so I thought I’d make a short video demonstrating its usage and it helped me grasp what was going on withing my script.

Below is a short video showing how I used it.  I hope it helps you as much as it did me!

AutoHotkey GUI control flow

Gui with Radio button and debugging

Office Automation

AHK Webinar- Simple and Associative Arrays in AutoHotkey

We had a great webinar on Arrays!  Here are links to the videosSimple and Associative Arrays in AutoHotkey

  • First hour video discussing below points
  • Second hour where we took a deep dive trouble-shooting an attendee’s script

Benefits of Simple and Associative Arrays in AutoHotkey

  • Speed – Objects are very fast!
  • Code maintenance / easier to update
  • Structured data
  • Easier to read / understand
    • Dot notation (names) can be very easy to read
    • Automatically group “variables” in a meaningful structure / Nesting deeper levels
  • Built-in functionality
  • Iterating over keys / values
  • Insert / Append to last
  • Remove / Remove last item
  • Count (Length)
  • Set / assign value (Index/Key – Value pair)
  • Retrieve / Lookup (Index/Key – Value pair)

Things to Remember with Simple and Associative Arrays in AutoHotkey

  • Keys are not case sensitive The following results in one key-value pair: {ex:1,EX:2}
  • Keys are unique (If you have duplicates, only the last one will be kept)
  • Simple Arrays can not have “empty” spots
  • Associative Arrays are not, necessarily, ordered in the way you’d expect (when iterate over can seem out of order)
  • Simple arrays are sequential
  • Simple Arrays can be considered Associative Arrays where the Index is the key
  • You must declare the object before or during population
  • To “nest” an object, you must declare the Parent and sub-objects first too!
  • Although the same, Lexikos recommends using { } for Associative Array & [ ] for Simple Array
  • You do not need to save the object to iterate over it
  • Arrays are often returned from API calls in JSON
  • While Simple and Associative Arrays in AutoHotkey take a bit of getting used to, in the long run, they are great time savers!

Resources for learning Simple and Associative Arrays in AutoHotkey

Featured script

Pasting clipboard to p.ahkscript.org– great for collaborating with others!

Additional Resources

During the webinar a few other scripts were mentioned.  Here are the links that were shared: