Here's what Window Spy looks like, after i manually hit Alt+n:
Here's my script.
#IfWinActive <Redacted title> ;Private info so don't want to post, but it works
^j::
Send, !n
WinGetActiveTitle, title
MsgBox, %title% ;Message Box shows expected title
WinGetText, createNewPrescriptionTitle, title
while (Instr(createNewPrescriptionTitle, "Create New Prescription") != 1)
{
Sleep, 1000
FileAppend, %createNewPrescriptionTitle% blah, log.txt ;The file contains " blah blah blah..."
WinGetText, createNewPrescriptionTitle, title
}
MsgBox, "Huzzah"
I've tried without the title as well. I tried with SetTitleMatchMode with Slow and Fast (documentation says it defaults to Fast, which matches what's in Window Spy).
Update: Looks like the Window Spy was v2, but my script was v1. I realized this once I started looking at WindowSpy.ahk, and I tried to use WinGetTextFast() from it in my script, instead of WinGetText. I got an error saying WinGetControlsHwnd wasn't recognized. I looked up WinGetControlsHwnd in the AutoHotkey.chm I'd been using, and it wasn't there. So then I googled it, and lo and behold it was a thing. That's when I noticed the version numbers on the documentation in my browser was v2, while the documentation in AutoHotkey.chm was v1. Haven't gotten it working yet, but I think I'm on the path.
