I wrote a script in AutoHotkey that can retrieve the elapsed time and duration from VLC,
via Microsoft Active Accessibility (MSAA).
^q::
WinGet, hWnd, ID, ahk_class QWidget ahk_exe vlc.exe
oAcc := Acc_Get("Object", "4.3.3", 0, "ahk_id " hWnd)
vText := oAcc.accChild(1).accName(0) " / " oAcc.accChild(3).accName(0)
oAcc := ""
MsgBox % vText
Return
You launch the script via Ctrl+Q, and it will output the time in a MsgBox.
You can use FileRead
and Loop, Parse
to find the matching point
in a subtitles .srt file for example. Or you could for example append the timestamp to a .txt file using FileAppend
and then read that into Java.
To use it:
You install AutoHotkey, maximum around 5 MB of space,
save the script as a .ahk file and double-click the file to run,
or save it as a .txt file and drag-and-drop it into one of the exe files in
C:\Program Files\AutoHotkey.
Download link here:
AutoHotkey
http://ahkscript.org/
Also you would need to download Acc.ahk and put it here:
C:\Program Files\AutoHotkey\Lib.
Instructions and download link here:
Acc library (MSAA) and AccViewer download links - AutoHotkey Community
https://autohotkey.com/boards/viewtopic.php?f=6&t=26201
Hope that helps.
Note: this is the sort of script that can potentially break, if VLC
do a radical update at some point, but that can be easily readjusted
to work correctly again.