Hi Aeliss,
thank you for your answer.
I did what you told me, but didn´t get it work. I´m a noob to scripting, so be patient with me.
I changed System.xml to following:
<System Type="Arcade">
<Name>Pinball</Name>
<AppPath>C:\Program Files (x86)\Visual Pinball\VPlaunch.exe</AppPath>
<RomPath>C:\Program Files (x86)\Visual Pinball\Tables</RomPath>
<SnapPath />
<VidPath />
<Emu selected="0">
<Cmd id="0" name="My Pinball Script" value=""%path\%file%ext"" />
<Cmd id="1" name="Future Pinball" value="/open "%path\%file%ext" /play /exit" />
</Emu>
<Extensions>.vpt,.fpt,.vpx</Extensions>
<Active>True</Active>
<Script>True</Script>
<Database>False</Database>
</System>
And my script looks like this:
#SingleInstance force
SetTitleMatchMode 2
DetectHiddenWindows On
SetWorkingDir %A_ScriptDir%
vpt=vpt
vpx=vpx
playme=/play
editme=/Edit
Table = %1% ;Variable direct table
SplitPath, Table, Tname, Tdir, Text, Tname_no_ext, Tdrive
SplitPath, Tdir,, vpdir
If (Text=%vpt%) or (Text=%vpx%)
{
goto Tabledetected
}
Table = %2% ;Variable from PinballX or batch file personal use.
SplitPath, Table, Tname, Tdir, Text, Tname_no_ext, Tdrive
StringTrimLeft, Table, Table, 1
SplitPath, Tdir,, vpdir
StringTrimLeft, vpdir, vpdir, 1
If (Text=%vpt%) or (Text=%vpx%)
{
if playme=%1%
function=%playme%
else
function=%editme%
goto Tabledetected
}
exitapp
Tabledetected:
IfInString, Table, physmod5
{
myexe=vpinball-physmod5-accelmod.exe
}
IfInString, Table, vpx
{
myexe=vpinballx.exe
}
if myexe=
{
myexe=VPinball991.exe
}
If function=%editme%
RunMytable =%vpdir%\%myexe% /Edit -“%Table%”
Else
RunMytable =%vpdir%\%myexe% /play -“%Table%”
Run, %RunMytable%
checkprocessagain:
Process, wait, %myexe%, 5.5
NewPID = %ErrorLevel% ; Save the value immediately since ErrorLevel is often changed.
if NewPID = 0
goto checkprocessagain
Process, WaitClose, %NewPID%
exitapp
return
with this I receive the error shown in picture error1
If I change the script an add the complete pinball executable path
myexe=C:\Program Files (x86)\Visual Pinball\VPinball991.exe
I receive the error shown in picture error2.
Any ideas what I did wrong?