IE Locking up & AutoHotkey's single threaded issue
Channel: AUTOHOTKEY Gurus
Date: 01/05/2021

In this session Isaias and I work through an issue with AutoHotkey.   Handling single threadedness of AutoHotkey and working around it.  First we tried with a subtimer however AHK still froze.  Thus we had to look for alternative solutions

TLDR: The key idea of the video is that AutoHotkey's single threaded technology causes Internet Explorer to lock up, but there are various methods to solve this issue, such as launching a separate instance of AutoHotkey or using the navigate function to execute JavaScript commands.

1. 00:00 🤔 IE freezing and AutoHotkey's single threaded issue causes frustration when automating file uploads, as using a set timer doesn't solve the problem.

2. 00:39 🔒 AutoHotkey's single threaded technology causes IE to lock up, but launching a separate instance of AutoHotkey can solve the issue; speaker emphasizes the importance of seeking help and shares their experience with creating a web browser control and handling file selection.
 2.1 AutoHotkey's single threaded technology causes issues with Internet Explorer locking up, but a specific solution involving launching a different instance of AutoHotkey to watch for and handle the window can be used.
 2.2 The speaker discusses their experience with working on internet explorer and the importance of asking for help, specifically in regards to creating a web browser control and selecting and sending files.

3. 02:30 📹 The speaker demonstrates a script that encounters an issue where it stops before completing a task due to AutoHotkey being single threaded and getting locked when a file dialog is opened in Internet Explorer.
 3.1 The speaker demonstrates a script that waits for a window to open, selects a file, and presses enter, but encounters an issue where the script stops before completing the task.
 3.2 Line 62 is the last executed line in the script, causing it to stop, and attempts to use a set timer to fix the issue were unsuccessful.
 3.3 AutoHotkey is single threaded, so when a file dialog is opened in Internet Explorer, the script gets locked and waits for the dialog to finish because it is not the owner of the window.

4. 05:49 💡 Using the navigate function to execute JavaScript commands on the window instead of directly querying the selector from the browser object in AutoHotkey can prevent Internet Explorer from locking up.

5. 07:39 💡 Using the navigate function to open dialogues in Internet Explorer can help resolve issues with JavaScript waiting for the dialogue instead of AutoHotkey.


6. 09:15 📝 Using the acc library can fix Internet Explorer's locking up issue, and potentially work for other programs, but passing variables between scripts can be complicated.
 6.1 The speaker discusses a simple solution for fixing a locking up issue in Internet Explorer using the acc library, which may also work for other programs.
 6.2 It is possible to use the iacc library or other methods to launch a script that waits for an active window, performs an action, and then exits, but passing variables between scripts can be complex and messy.

7. 11:21 🔒 The main idea is that there are multiple ways to solve the issue of Internet Explorer locking up, and while using "set timer" can simulate multi-threading, it doesn't actually provide true multi-threading functionality.


8. 12:30 📺 The script breaks when the IE window is closed, but adding a sleep function before clicking may help prevent the break; the speaker suggests using a set timer to solve the issue of the script waiting, but acknowledges the possibility of an infinite loop and concludes that sticking with the current solution is the best approach.
 8.1 The script breaks when the IE window is closed, but adding a sleep function before clicking may help prevent the break.
 8.2 The speaker suggests using a set timer to solve the issue of the script waiting, but acknowledges that it may lead to an infinite loop and concludes that the best approach is to stick with the current solution.