the-🅰utomator Live 🅰HK Support
Channel: AUTOHOTKEY Gurus
Date: 2022-07-22

TLDR: The video discusses various tips and tricks for automating tasks in different programs using AutoHotkey and Python, including using the scintilla control, detecting mouse dragging, and encapsulating GUI data and behavior inside a class.

1. 00:00 👀 The speaker discusses their search for a simpler way to have text always visible and changeable, and suggests looking into the scintilla control for assistance.
 1.1 No clear information or topic was discussed in the lecture.
 1.2 The speaker discusses their search for a simpler way to have text always visible and changeable, and suggests looking into the scintilla control for assistance.
 1.3 The speaker demonstrates how to adjust the size and position of controls in a GUI using a script and shares a technique for resizing a Scintilla control with the window.
 1.4 The speaker is searching for a specific answer related to GUI size while the audience asks a second question about the scintilla control.
 1.5 To remove the horizontal scroll bar and enable text wrapping, set the wrap mode to word and leave the width at 380 pixels.

2. 15:51 👨‍💻 Summer heat is disliked and FreeCAD's open source design authoring software can be improved with autohotkey scripts and context-sensitive hotkeys.
 2.1 The speaker discusses the passing of time and their dislike for the summer heat.
 2.2 The speaker demonstrates an open source design authoring software called FreeCAD.
 2.3 To avoid convoluted muscle memory, use one auto hotkey script across all programs instead of maintaining custom keyboard shortcuts for each program.
 2.4 Use context-sensitive hotkeys to streamline your workflow across different programs.
 2.5 Using autohotkey to execute keystrokes when holding down and dragging in FreeCAD can save time and improve efficiency.

3. 21:42 🤖 Automating activities in different programs is challenging, but checking for active windows and using window grouping can help.
 3.1 Automating the same activity in two different programs is challenging due to different control methods, but checking for active windows and using window grouping can help.
 3.2 The speaker discusses the challenge of implementing click and drag functionality in FreeCAD and explains that most design software uses the default method of selecting items by clicking and dragging.
 3.3 Intercept left click over drawing section of FreeCAD to execute key commands required for dragging.
 3.4 Measure the time while a key is pressed using the get key state function.
 3.5 To get the starting position of a mouse drag in a program, the command needs to be executed before the dragging starts, and in most programs, the default is left click drag, but in this program, it is shift b then drag right.
 3.6 The speaker discusses sending clicks and simulating dragging in a program, including using mouse move and a routine for drag select.

4. 30:18 🐭 Use an algorithm to detect mouse dragging and replay the action, try sending sv and a click or using the drag mouse option, and consider the UI automation approach of a new Python program.
 4.1 The lecture discusses an algorithm for detecting whether the mouse is being dragged or not and how to replay the dragging action if it is being dragged.
 4.2 Try sending the sv and a click to see if the software automatically drags for you, otherwise try using the drag mouse option or check out the function that gives you the x y positions for a click and drag selection.
 4.3 An on-screen display tool can show what is happening with the mouse, but it is important to keep in mind that it is inside a loop and may not work as expected.
 4.4 Debugging can be aided by inspecting the program's messages and potentially triggering them instead of manually replicating actions.
 4.5 The speaker is excited to learn about working with if else statements in scripting and will also try out a useful mouse selection script.
 4.6 The program is fairly new, written in Python, actively developed and open source with a new version recently issued, and the UI automation approach is worth considering.

5. 41:10 🔍 The speaker found solutions to resizing and moving windows using AutoHotkey and the wind move command, and enabling text wrapping in the scintilla control.

6. 50:45 📝 Using "by ref" in functions copies the address of a variable, allowing access to its location rather than its value, which can be useful for avoiding global variables and returning multiple values.

7. 01:01:02 💻 Resizing controls and setting variables in application development, with discussion on encapsulating GUI data and behavior inside a class.

8. 01:08:50 💻 Version 2 allows classes to be used as event syncs with all functions as methods, while version 1 only allows functions or labels to be used.

Consider joining the AHK Hero group.  We stream 3 more hours, privately, on Zoom and have a private chat group.  https://the-Automator.com/AHKHero