This is my first post and I am a complete beginner to this wonderful language.
I have 2 folders both containing MP4 files named like partn.mp4 where n is an integer.
I have a playlist file that contains the absolute path of each file like C:\Series\Show\part1.mp4, C:\Series\Adv\part2.mp4 and so on…
Series contains even numbered files (part1.mp4, part3.mp4,…), Adv contains odd ones.
Media player classic will play these files if given the playlist as an argument.
What I need is a way to send a Ctrl-4 to odd numbered ones, I only limited myself to 3 parts for simplicity, so I need to send the keystroke to part2.mp4
This code sends the keystroke to all files.
Other codes that I’ve tried create race conditions and only the last file will play, any help.
I am not attached to creating a playlist, any solution is fine.
mpc-hc.exe playlist.m3u /play
[void][System.reflection.assembly]::loadwithpartialname('system.Windows.forms')
Foreach ($line in get-content playlist.m3u) {
If ($line.substring($line.length-5,1) -match 2) {
[System.Windows.forms.Sendkeys]::sendwait("^4")
}
}