Unleash the power of AutoHotkey with these FOUR creative solutions to one common problem
Channel: AUTOHOTKEY Gurus
Date: 2022-12-13

Here we review four completely different approaches for solving a problem I had.   AutoHotkey is Amazing!

Learn more about HotStrings: https://the-Automator.com/HotStrings
TLDR: Automate actions with Hotstrings and functions to improve workflow and maintainability.

1. 00:00 💻 We'll explore 4 solutions to a typing issue & get feedback from azaleas, considering if we need to add/strip elements to make it trackable.
 1.1 We'll cover four different solutions to a typing issue, each with different uses and benefits, and get feedback from azaleas.
 1.2 When creating a link, consider if you need to add a query parameter or strip out certain elements to make it clean and trackable.

2. 01:54 🤖 Automate actions with Hotstrings and functions, while checking the Caps Lock key state for true/false.
 2.1 Hotstrings and functions can be used to perform the same action with slight variations, allowing for easier automation.
 2.2 It takes the clipboard, starts at the ninth position, and trims off the first question mark.
 2.3 Checking the key state for the caps lock will determine if it is true or not.

3. 05:16 🔑 Using a different key as a toggle instead of Caps Lock can prevent AutoHotkey from sending text in the wrong case.
 3.1 Depending on the toggles, pre and post values are added, without needing to use brackets.
 3.2 Using the C1 property or a different key as a toggle instead of Caps Lock can prevent AutoHotkey from sending text in the wrong case.

4. 07:05 🔑 Press the numlock key twice to toggle a variable on or off for any action.
 4.1 Hit the numlock key to type letters, not the alt key, as the alt key cannot be used as a toggle.
 4.2 You can now add a hotkey to toggle a variable on or off, allowing you to keep a sticky state for a while.
 4.3 Pressing a key twice or three times can turn on a toggle, allowing for any action to be modified with a variable.

5. 10:16 🔑 Called a function to check if a key was pressed with a delay, using one variable with different values.
 5.1 You can call a function with parameters to determine whether to strip stuff from the beginning, add two pre and post, or send it raw.
 5.2 I called a function to check if a key or key combination was pressed down with a delay to allow time for the key to be pressed.
 5.3 Create one variable with different values and use logic on it.

6. 12:37 🔑 Use the key wait command to wait for a key press and perform an action, with a timeout if no key is pressed.
 6.1 If the left Windows key is down, the folder will open, otherwise the URL will be sent.
 6.2 You can use the key wait command to wait for a key press and perform an action, with a timeout if no key is pressed.
 6.3 Using a set timer and getting the key state of each key can be used as a workaround for the sleep command, with the added benefit of having a timeout.

7. 15:29 🤔 Automate your workflow with context-sensitive hotkeys and hotstrings, and use copy/paste or search/replace to modify multiple lines of text.
 7.1 I realized I could have context sensitive hotkeys or hotstrings depending on the situation.
 7.2 Canva automates the process of creating YouTube thumbnails, eliminating the need to think about the next step.
 7.3 To modify multiple lines of text, select the words you want to change and use copy/paste or search/replace.
 7.4 Using active windows to call a function and passing parameters to it is the best solution for hotstrings.

8. 19:29 🔑 Automating functions with action passing and hotkeys can make code easier to maintain and understand.
 8.1 Passing an action and checking for a hotkey can be used to automatically trigger a function.
 8.2 If the case is Lea, I can get the last three digits and use if/else statements to send the page "learn" to my SO.
 8.3 A combination of if-win-active with one function is easier to maintain than hundreds of lines of code modified in three places.
 8.4 Organizing code into sections makes it easier to understand and everyone can understand it the same way.
 8.5 Parsing HTML tags can be easily done with AutoHotkey, and subscribing to the channel helps support it.