Here is the final AHK, new users please compile as exe, run Pinball Arcade in Other systems, follow bduncan's instructions in earlier posts.
Note, VLC must be already working to launch on your backglass fullscreen everytime, this must be tested outside the script. Your monitor must be already rotated portrait for the video backglasses part to work, otherwise if you just want to update the last table played use the earlier AHK script i posted. Make sure FreeCamMod's own backglass folder is empty, and that you either have only one mp4 backglass video or a png image for the same rom if no mp4 video bg was available. If the same rom or table has a video and png image both in Backglass videos and Backglass images folder in your Pinball arcade media folder, then two VLC instances will open and PNG image backglass will be on top.
I am using 32 bit VLC player which installs to program files (x86) if you grab the 64 bit version you must change this path to just "program files".
Process, Close, pinballx.exe
bgmp4 = D:\PinballX\Media\Pinball Arcade\Backglass Videos\%1%.mp4 ;Change paths and extentions throughout to match your setup
bgpng = D:\PinballX\Media\Pinball Arcade\Backglass Images\%1%.png
if FileExist(bgmp4)
Run C:\Program Files (x86)\VideoLAN\VLC\vlc.exe --loop "D:\PinballX\Media\Pinball Arcade\Backglass Videos\%1%.mp4"
if FileExist(bgpng)
Run C:\Program Files (x86)\VideoLAN\VLC\vlc.exe --loop "D:\PinballX\Media\Pinball Arcade\Backglass Images\%1%.png"
Run C:\TPAFreeCamMod.exe -table %1%
~Escape::
Process, Close, PinballArcade11.exe
Process, Close, vlc.exe
FileRead, xmldata, D:\PinballX\Databases\Pinball Arcade\Pinball Arcade.xml ;change to your pinball arcade database
doc := ComObjCreate("MSXML2.DOMDocument.6.0")
doc.async := false
doc.loadXML(xmldata)
table = //game[@name='%1%']/description
Node := doc.selectSingleNode(table)
description:= Node.text
IniWrite, %description%%1%System_2, D:\Pinballx\Config\PinballX.ini, Internal, lastselected ;change drive letter and system number, for me its 2 in Other Systems so _2
IniWrite, All Tables, D:\Pinballx\Config\PinballX.ini, Internal, filtername
Run D:\Pinballx\PinballX.exe
ExitAPP
return