• Become a Power user Intro to AutoHotkey Intermediate AutoHotkey Intermediate Objects GUIs are Easy w/AutoHotkey Painlessly switch from V1 to V2

AHK News- 2024-07-18-Reflections on the Trump Assassination Attempt

Howdy %Name%,AutoHotkey Newsletter

I find myself thinking about the assassination attempt on ex-President Donald Trump.

Regardless of where one stands on the political spectrum violence is not the answer.  “Ideas and Beliefs” are where our “battles” should be fought not with a guns and “in the shadows”.

Thank God the attack was a failure as I truly don’t know what would have happened to the United States had it of been successful.  I truly hope we all see this as a sobering moment and silence the political rhetoric.

As we move forward, let us reflect on the values that define our democracy: freedom, justice, and respect for all individuals.

We need to get back to the belief that our differences make us a better country and settle our disputes intellectually, not physically.

Joe Glines

Now on with the show…

Learn how to Master VSCode Make the switch to v2 Intro to AutoHotkey Intermediate AutoHotkey Intermediate Objects GUIs are Easy w/AutoHotkey Access all our Courses; Quit when you want

Matching Dates with a Regular Expression

To offer more bonuses for our Intro to Regular Expressions course I tasked Rizwan with putting together a list of common Regular Expression “recipes”.  Rizwan is the newest member of our team and is continuing to discover the power of AutoHotkey.   One he found very interesting because it was so powerful.  We decided to record a short session discussing Regular expressions and naming subgroups.  You can check out the meeting here.

Learning how to Match Dates with Regular Expressions
Learning how to Match Dates with Regular Expressions | Regex is cool


Offset & Indirect with Excel

If you’re an Excel user, knowing how to use Offset is insanely powerful.  During a private client call with Scott (an AHK Hero member) Irfan mentioned using Indirect (which I’d never heard of).  After the private call we recorded this short video explaining how and when, to use each one.

Using Offset and Indirect in Excel with AutoHotkey
Using Offset and Indirect in Excel with AutoHotkey


Interactive Chart of AutoHotkey Developer-Lifecycle

I was playing around with Claude projects and decided to create a tool that I’ve been wanting for a while.  I provided some general info, titles, and corresponding editors/IDEs and AutoHotkey course depending on where the user is on the lifecycle.  You can see the interactive chart here.


Improving People’s Lives: Story #8

When I worked at Texas Instruments I was chatting on the phone with a colleague. He told me he was trying to update the Mind of Engineer survey to encorporate the 11 languages. The process was painfully slow and required thousands of copying and pasting.  I asked him to give me a few minutes and I’d get back to him.

A few minutes later I called him back and asked him to join me on WebEx.  I demonstrated a script that allowed me to hit one hotkey and it would transfer 5 of the labels.  If I hit a different hotkey it would transfer 20 labels.

With just 5 minutes of work I made a new friend for life!


What we’re reading


AI / Chat GPT-3 News / Usage


⚡️Productivity tips: Isolate yourself from distractions

I was on a client call discussing one of my favorite books from Dan Kennedy: No B.S. Time Management for Entrepreneurs.  I remember this interview with Dan on the topic which will give you some good tips to follow.

The No B.S. Time Management Masterclass with Dan Kennedy

The No B.S. Time Management Masterclass with Dan Kennedy


A spot of Humor Trump on Who wants to be a millionaire

Donald Trump on Who Wants To Be A Millionaire
Donald Trump on Who Wants To Be A Millionaire


What we automated this week with AutoHotkey #53

We had 84 AutoHotkey files that were modified this week.   This recording I breezed through our week of automation a bit fast as it was the 3rd time recording the video.  Take a look at what we did here.

What we automated with AutoHotkey #53

What we automated with AutoHotkey #53


Testimonial

AHK Hero

Consider joining the AHK Hero club! Members receive 25% off courses, consultations, tutoring, done for you project work, etc.    Currently we have over 285 hours of recordings teaching AutoHotkey that is exclusive to AHK Hero members❗

During this Friday’s call we’re planning to discuss:

  • Avoiding “magic numbers” in your code
  • Using DirSelect verse FileSelect for Directories
  • Pausing DropBox (or other Cloud tools) to avoid Files being locked when using FileAppend
  • Using a Scintilla control in an edit field with v2 code
  • Different ways to identify your program (PID, HWND, AHK_class, AHK_exe)
  • Saving a screen shot (for debugging) to a folder without any 3rd party libraries
  • Using Tabs in a GUI and a Statusbar– Weird breaking of GUI
  • Working with DLLs in v2

They also have access to exclusive & pre-released content and a 3 hours a week where we help people with their AHK issues (the Saturday calls are geared towards people new to AutoHotkey.)


️ Quotable quotes

  • Success comes from failure. Not from memorizing the right answers. Donald Trump
  • Decisions without actions are worthless Dan Kennedy
  • How you deal with failure determines whether or not you ever get to deal with the success Dan Kennedy

AHK Newsletter⏩SHARE WITH A FRIEND⏩

Do you know someone that would benefit from learning useful automation tips like the gems in today’s issue?  Take a second and forward this newsletter and bask in the glow of their undying gratitude.  Was this email forwarded to you?

Sign up for this Newsletter hereWe never share your email with anyone.  Ever!


The-Automator

Joe, Isaias, Irfan, Rizwan and staff


P.S. Personally I feel our nation’s divide, while kindled by politicians, is blazed by mass media.  Don’t let the media convince you of things you don’t see or feel!

Choosing the Right Way to Identify Windows in AutoHotkey

Hey there, fellow automation enthusiasts! Today, we’re diving into the wild world of AutoHotkey and exploring the different ways you can identify windows and programs. Don’t worry if you’re not a coding wizard – I’ll break it down in a way that’ll make you feel like a pro in no time.

Why Does This Even Matter?

Before we jump in, let’s talk about why identifying windows is such a big deal in AutoHotkey.

Imagine you’re trying to automate your daily grind – maybe you want to automatically organize your work files, or set up a shortcut to launch your favorite apps.

To do any of this cool stuff, AutoHotkey needs to know which window or program you’re talking about.

It’s like giving directions to a friend – you need to be specific, or they might end up at the wrong place!

The Fantastic Four: PID, HWND, AHK_class, and AHK_exe

AutoHotkey gives us four main ways to identify windows and programs. Think of them as different superpowers you can use to point at the exact window you want to control. Let’s break them down:

1. PID: The Unique ID Badge

PID stands for Process ID. Imagine every program running on your computer has a unique employee badge. That’s what a PID is – a unique number assigned to each running program.

When to use PID:

  • You need to target a specific instance of a program
  • You’re dealing with multiple instances of the same program and need to pick one

PID Pros:

  • Super specific – each PID is unique
  • Great for differentiating between multiple instances of the same program

PID Cons:

  • PIDs change each time you run a program, so your script might need updating

Learn more about using PIDs in the AutoHotkey documentation.

2. HWND: The Window’s Secret Codename

HWND (pronounced “H-wind”) stands for Handle to Window. If PID is like an employee badge, HWND is like a secret codename for each window. Every window gets its own HWND.

When to use HWND:

  • You need to target a specific window, not just a program
  • You’re working with complex applications that have multiple windows

HWND Pros:

  • Very precise – each window has its own HWND
  • Useful for applications with multiple windows

HWND Cons:

  • Like PIDs, HWNDs change each time a window is created
  • Can be overkill for simple scripts

Discover more about HWNDs in the AutoHotkey HWND documentation.

3. AHK_class: The Window’s Family Name

AHK_class is like a family name for windows. All windows created by the same type of program often share the same class name.

When to use AHK_class:

  • You want to target all windows of a certain type
  • You’re working with standard Windows applications

AHK_class Pros:

  • More stable than PIDs or HWNDs – doesn’t change between program launches
  • Can target multiple windows of the same type easily

AHK_class Cons:

  • May be too broad if you need to target a specific window
  • Some programs use generic class names, which can lead to confusion

Find out more about AHK_class in the AutoHotkey class documentation.

4. AHK_exe: The Program’s Name Tag

AHK_exe is probably the simplest to understand – it’s just the name of the program’s executable file (like “chrome.exe” for Google Chrome).

When to use AHK_exe:

  • You want to target all instances of a specific program
  • You’re writing simple scripts for well-known applications

AHK_exe Pros:

  • Super easy to use and understand
  • Doesn’t change unless the program is renamed or moved

AHK_exe Cons:

  • Can be too broad if you need to target a specific window
  • Might not work well with programs that have multiple executables (but you can use GroupAdd to help with this)

Learn how to use AHK_exe in the AutoHotkey executable documentation.

Choosing Your Superpower

So, how do you decide which method to use? Here’s a simple guide:

  1. If you’re just starting out or writing a simple script, go with AHK_exe. It’s the easiest to understand and use.
  2. If you need to target all windows of a certain type (like all Notepad windows), AHK_class is your friend.
  3. If you’re dealing with a complex application and need to target a specific window, HWND is the way to go.
  4. If you need to differentiate between multiple instances of the same program, PID is your best bet.

Remember, you can often combine these methods for even more precision. For example, you might use AHK_exe to target a specific program, and then use HWND to pick out a particular window within that program.

Real-World Examples

Let’s look at some everyday scenarios to see how you might choose between these methods:

  1. Scenario: You want to create a hotkey that always brings up your work email.
    Solution: Use AHK_exe to target your email client (e.g., “outlook.exe”).
  2. Scenario: You’re working with multiple Chrome windows and want to focus on a specific one.
    Solution: Use HWND to target the exact window you need.
  3. Scenario: You want to create a script that works with all open Notepad windows.
    Solution: Use AHK_class to target all Notepad windows at once.
  4. Scenario: You’re running two instances of a game and want to automate actions in one of them.
    Solution: Use PID to differentiate between the two instances.

Mixing and Matching: The Power Combo

Now, here’s where things get really exciting: you can mix and match these window identification methods! This is like combining superpowers to become the ultimate AutoHotkey hero. Let’s dive into how you can do this, with a special focus on combining ahk_exe and ahk_class.

Why Mix and Match?

Sometimes, using just one method isn’t enough to pinpoint exactly the window you want. By combining methods, you can be super specific and avoid any confusion in your scripts.

The Dynamic Duo: ahk_exe and ahk_class

The combination of ahk_exe and ahk_class is particularly powerful. Here’s why:

  • ahk_exe narrows down to a specific program
  • ahk_class helps you target a specific type of window within that program

For example, let’s say you’re working with Microsoft Word and want to target only the document windows, not the splash screen or dialog boxes. You could use:

ahk_exe winword.exe ahk_class OpusApp

This tells AutoHotkey: “Find me a window that belongs to Microsoft Word (winword.exe) and is a document window (OpusApp class).”

More Mixing Examples

  1. Chrome with a specific title:
    ahk_exe chrome.exe ahk_class Chrome_WidgetWin_1 MySpecificTabTitle
    This targets a Chrome window with a specific tab title.
  2. Notepad with specific content:
    ahk_exe notepad.exe ahk_class Notepad MySpecificTextContent
    This looks for a Notepad window containing specific text.
  3. File Explorer in a specific location:
    ahk_exe explorer.exe ahk_class CabinetWClass C:\MyFolder\
    This targets a File Explorer window open to a specific folder.

Tips for Mixing and Matching

  • Start broad, then narrow down: Begin with ahk_exe to select the right program, then use ahk_class or other identifiers to be more specific.
  • Use Window Spy: AutoHotkey comes with a tool called Window Spy that can help you identify the correct ahk_exe and ahk_class for any window. You can access it by right-clicking on the AutoHotkey icon in your system tray and selecting “Window Spy”.  Or get the-Automator Spy which is our version but jazzed-up!
  • Test, test, test: Always test your combined identifiers to make sure they’re targeting exactly what you want.
  • Be as specific as necessary: Only add as many identifiers as you need to uniquely identify your target window. Too many can make your script brittle.

Remember, you’re not limited to just combining ahk_exe and ahk_class.

You can mix and match any of the window identification methods we’ve discussed. The key is to experiment and find the combination that works best for your specific automation needs.

For more detailed information on combining window identification methods, check out the AutoHotkey documentation on combining criteria.

Wrapping Up

Choosing the right method to identify windows in AutoHotkey is like picking the right tool for a job. Sometimes a hammer (AHK_exe) is all you need, but other times you might need a more specialized tool (like HWND or PID).

Don’t be afraid to experiment with different methods. The more you play around with AutoHotkey, the better you’ll get at choosing the right identification method for each task. Before you know it, you’ll be an AutoHotkey window-whisperer, commanding your computer to do your bidding with just a few lines of code.

Remember, the goal is to make your life easier and your work more efficient. So go forth, my fellow automation adventurer, and may your scripts be ever bug-free and your windows always identifiable!

Happy scripting!

For more information and tutorials, check out the official AutoHotkey documentation.

AutoHotkey Newsletter 2024-07-11 You’re not nearly lazy enough!

Howdy,

I’m pretty sure I’ve spoken to more AutoHotkey users on the planet than anyone else. 

We share a lot of similarities.  Here are a few to see if you’d describe yourself similarly

  • You hate wasting time!
  • You love solving problems
  • Your curious and self-motivated
  • Your pragmatic & focus on practical solutions
  • You’d rather ask for forgiveness than permission
  • You care more about “getting things done” than getting the credit
  • You are a long-term thinker often sacrificing immediate solutions to save more time later

One thing you’re not is lazy

It’s this last one as to where I want to try and get you reconsider your mindset.

I think a lot of people don’t get help because they think having someone help would be a sign of being lazy or “cheating”.

Over the past 11 years I’ve spent countless hours on online calls with AutoHotkey experts like Maestrith, Isaias Baez, GeekDude, Irfan, Jean Lalonde, Tank, etc. and have made enormous gains in my programming knowledge by watching how they solve problems with AutoHotkey.

When I was working daily with Maestrith I realized people with their knowledge could

develop tools in hours that would take me weeks

And not only would their tools be more robust, but they would also be written in a way that made changes & updates easier to apply.

I also realized that, by working with them to develop the tools, it was far easier to expand my programming skills because they were working on a project that I was familiar with.
Many times we’d be covering a topic and I’d see code on the screen I didn’t understand and ask them to explain it to me

These mini-sessions would leap-frog me forward in my skills and abilities.  We do offer tutoring sessions and not nearly enough of you are taking us up on it.
I guarantee you’ll experience enormous growth when we work with you on your code!

Its one of the core things we do during the AutoHotkey Hero calls.  We start off each call by asking if anyone needs help with something.

Now on with the show…

Learn how to Master VSCode Make the switch to v2 Intro to AutoHotkey Intermediate AutoHotkey Intermediate Objects GUIs are Easy w/AutoHotkey Access all our Courses; Quit when you want

Easily summarize Local media files

Isaias has been updating our Chat GPT API class.  I realized they had incorporated their Whisper model which does an amazing job transcribing audio.  It reminded me of a conversation I was having with a client/friend of mine that works in Market Research.  

He’ wanted to be able to, easily, summarize his meetings.   Initially he also wanted to, somehow, use AutoHotkey to record the call (probably automating OBS) however I realized, if we just start by using an Audio/Video file, we could easily get something started for him.   While this is a work in progress, you can check out what we got done so far in this video.

Great AI Tool for Sumarizing videos and Extracting Learnings
Great AI Tool for Sumarizing videos and Extracting Learnings


AutoHotkey Resource Finder

Many of our clients will reach out and ask us if we have a video, script, link on a given topic.
I realized, it wouldn’t be that hard to create a tool that would put together many of our resources.  I also realized we could add both v1 and v2 AutoHotkey help from Documentation.
We created the-Automator Resource finder which has been a huge hit!  You can check out how the tool works in this video.

Super helpful AutoHotkey Resource Finder
Super helpful AutoHotkey Resource Finder

What would you do with the above tool❓


Add a CoPilot Key to your Keyboard

Microsoft is up to their usual shenanigans.   In Windows 11 they had innitialy added a built-in Hotkey (Windows+C)  however later they decided to remove it (I guess they want to sell more keyboards?
In this video I show how easy it is to add it back with a hotkey.

How to Create your own CoPilot Hotkey without buying a new Keyboard
How to Create your own CoPilot Hotkey without buying a new Keyboard


Improving People’s Lives: Story #7

Last week we had a call with an amazing AutoHotkey developer that was partially sight impaired.  He was doing amazing work but needed some help nudging his tool to be more robust for other users.
By the end of the call I we were able to greatly improve his code’s efficiency and reliability plus level him up!


What we’re reading


AI / Chat GPT-3 News / Usage

15 INSANE Use Cases for NEW Claude Sonnet 3.5! (Outperforms GPT-4o)
15 INSANE Use Cases for NEW Claude Sonnet 3.5! (Outperforms GPT-4o)


⚡️Productivity tips: Plan Sprints!

We all know we can’t “run” at full speed all day.   We can, however, intermix short bursts throughout our day.   Schedule yourself to have “ sprints ” where you crank out small tasks by working feverishly!


A spot of Humor – “The Internet” speech from the IT Crowd

Whoever wrote this definitely worked in Corporate America!  I can say truthfully there would be a lot of people that would believe this!

The Internet Speech | The IT Crowd
The Internet Speech The IT Crowd | Series 3 Episode 4


What we utomated this week with AutoHotkey #52

This week I start out showing how I almost died Sunday then cover 75 AHK scripts we worked on in this video.

What we automated with AutoHotkey #52
What we automated with AutoHotkey #52


Testimonial

I am so thankful for all you are doing to help us in this conversion and our mission to produce a solid product. Stephanie Holland

AHK Hero

Consider joining the AHK Hero club! Members receive 25% off courses, consultations, tutoring, done for you project work, etc.    Currently we have over 282 hours of recordings teaching AutoHotkey that is exclusive to AHK Hero members❗

During this Friday’s call we’re planning to discuss:

  • Sliders– Index/Bookmarks and updating COM object while dragging
  • Using Tabs in a GUI and a Statusbar– Weird breaking of GUI
  • Working with DLLs in v2
  • Pausing DropBox to avoid Files being locked when using FileAppend
  • Making Functions in scripts available by creating a COM object
  • Center text in a GUI (with one line)
  • KeyWait (watching for keypress to be let go)

They also have access to exclusive & pre-released content and a 3 hours a week where we help people with their AHK issues (the Saturday calls are geared towards people new to AutoHotkey.)


️ Quotable quotes

  • I will always hire a lazy person to do a hard job, because they will always find an easy way to do it Bill Gates
  • Whatever Your Mind Can Conceive and Believe, It Can Achieve Napoleon Hill
  • Decisions without actions are worthless Dan Kennedy
  • S.Y.S.T.E.M. Save Your Self Time Energy & Money

AHK Newsletter⏩SHARE WITH A FRIEND⏩

Do you know someone that would benefit from learning useful automation tips like the gems in today’s issue?  Take a second and forward this newsletter and bask in the glow of their undying gratitude.  Was this email forwarded to you?

Sign up for this Newsletter hereWe never share your email with anyone.  Ever!


The-Automator

Joe, Isaias, Irfan, Rizwan and staff


P.S. The intro about not being lazy enough is % serious. 

I’m so confident that you will be blown-away by our support I’m willing to give a full refund to anyone that can honestly say were not 100% satisfied during a tutoring session

So don’t wait.  Reply to this email and let’s figure out a time to level you up❗