I use AutoHotkey every day but find it’s not very reliable. I have one script that checks if the current window is File Explorer and if it is, gets the currently selected file or directory and does something with that. If I have more than one tab open, it will usually (but not always) give me the selected item from a different tab. Reloading the script fixes the issue sometimes.