joedf wrote: ↑09 Oct 2019, 08:25
If we use a sendinput instead, the desired behaviour is achieved. … I just tried again today.... and it worked either way... hmmm
Hmm, indeed. I tried it with
sendinput, but it didn't work. Then I reverted it to
send and added a
msgbox call to see the hotkey just before the send command, and now it.

Now I'm wondering if it's a race-condition, some sort of timing issue. I'm not sure why this only affects Firefox though.
I just tried it in a fresh VM and got the same results on my main system:
- All versions work in Windows Explorer, Notepad, Chrome, everywhere
- All version of raw script work in Firefox
- Compiled script with msgbox before send works in Firefox
- Compiled script without msgbox (with send or sendinput) does NOT work in Firefox
- Replacing msgbox with tooltip makes it stop working in Firefox again
- Adding a sleep delay doesn't make it work, only msgbox seems to work
I just downloaded the latest version of AHK and compiled it with the .bin files from that and it seems to work. I'm not sure what's different (maybe the compiler was defaulting to ANSI instead of Unicode—which still wouldn't explain why it was only failing in Firefox). Regardless, it seems to work properly now.
Also, I don't use the compiler that comes with AutoHotkey, I use the old compiler-wrapper (with the joystick icon) which provides a lot more control over the resulting executable. Passing the new (Unicode) .bin file to the old compiler also works.

(I don't know why Unicode emojis are so huge on this message board.

)