Thanks for taking the time to spell it out for me Tiger, I needed it. Running the position tag from the command prompt worked just fine. It came up real quick, less then 2 seconds. When I added it to the script and tried to run that from the command prompt I got another run-time error (see attached) when pressing pause once gridlee was running. If it matters, the AHK icon did appear on my task bar before I started up Mame.
I double checked this with your instructions, but just in case I screwed this up along the line, here are my exact steps and my .ahk:
Open command prompt on E:\J5
type 'Start johnny5.ahk gridlee' and hit enter
Open command prompt on E:\mame
type 'mame gridlee' and hit enter
#SingleInstance force
#Persistent
; The asterisk prefix makes the remapping more complete on XP/2k/NT. For 9x systems you can
remove it.
DetectHiddenWindows, On
ScreenState =0
SetKeyDelay, 250,250
~p::
{
if ScreenState > -1
{
If ScreenState =1
{
ScreenState=-1
send, {Escape down}
send, {escape up}
WinActivate,%Title%
WinRestore,%Title%
WinActivate,%Title%
WinWaitActive,%Title%
sleep 250
Send,{p down}{p up}
ScreenState=0
}
else
{
ScreenState=-1
WinGetActiveTitle, Title
sleep 100
J5=Johnny5.exe %1% -position 0,0,800,600 -ahk 1000
if 0 >1
J5=%J5% -clone %2%
if 0 >2
J5=%J5% -driver %3%
if 0 >3
J5=%J5% -emu %4%
Run,%J5%, e:\j5, max
ScreenState=1
}
}
}
return
~Escape::
if ScreenState=1
{
ScreenState=-1
WinActivate,%Title%
WinRestore,%Title%
WinActivate,%Title%
WinWaitActive,%Title%
sleep 250
Send,{p down}{p up}
ScreenState=0
}
else
{
ExitApp
}
return