I can't test this, but it looks cleaner (if you remove all the comments)...
Code:
#SingleInstance force
SetKeyDelay, 40
SetTimer, WatchBF2
return
WatchBF2:
SetTimer, WatchBF2, Off
Loop
{
; Get the process name of the active window (i.e. notepad.exe)
WinExist("a")
;WinGet, id, id
WinGet, pn, ProcessName
if pn=bf2.exe
Suspend, off
else Suspend, on
WinWaitNotActive
}
return
;//really need the hook?...it don't "send itself"...
;//$^v::
^v::
Sleep, 219
;//you should set this in the auto-execute section, if this is the only thing this script does...
;//SetKeyDelay, 40
;//SendRaw ensures no surprises on the clipboard...
SendRaw, %clipboard%
;//use %A_Space% if you still need a space...
;//SendRaw, %A_Space%%clipboard%
;//at the very least, you don't need to undo the change, since this is a sub-routine...
;//SetKeyDelay, 0
return
_________________
AutoHotkey-Hotstring.ahk - Helping the world spell "AutoHotkey" correctly! (btw, it's a lowercase k!)