The script will start the film and when i see something interesting i can push on AHK button, then this will pause the film and then i write the time and the observation to a csv file.
How can i catch the time from the playing/pause film (VLC) ?
(data form VLC Status bar)
/* 2011-01-19 Cher Adamczyk observation timer program small part for testing <test get_time from VLC ??> */ ; Generated using SmartGUI Creator 4.0 ;==========GUI 1:========================================================= Gui, Add, Button, x020 y020 w070 h030 , Start Gui, Add, Button, x020 y060 w070 h030 , Finish Gui, Add, Button, x020 y100 w120 h030 vPauzeOnOff , PauzeOnOff PauzeH = Pauze-OFF GuiControl, Text, PauzeOnOff, %PauzeH% Gui, Add, Button, x020 y140 w120 h030 , VLCtestCom Gui, Add, Button, x020 y200 w120 h030 , VLCGetTime Gui, Show, x000 y000 w200 h240, Cher(NL) test how to get time from VLC Return ;=====How can I get the actual time from VLC like get_time on console=======================; ;=====I want to write this to cher.csv =====================================================; ButtonVLCGetTime: gosub ButtonPauzeOnOff inputbox, Chertime, ,What is the observation time? inputbox, Cherobserv, ,Wich observation? MsgBox, record %Chertime% %Cherobserv% FileAppend, %Chertime%`,%Cherobservation%`n , %WorkingDir%Cher.csv gosub ButtonPauzeOnOff return /* ; get_time {t} ; ControlGet, vlcHwnd, hwnd, , ToolbarWindow321, VLC media player ; ControlSend, CherGetTime , {t}, ahk_id %vlcHwnd% WinGetText, wText, VLC media player ;WinGet, wText, id, VLC media player MsgBox, %wText% Loop, Parse, wText, `n, `r { if A_Index = 1 Var1:=A_LoopField if A_Index = 3 { Var2:=A_LoopField break } } MsgBox % Var1 "`n" Var2 MsgBox, CherGetTime %CherGetTime% FileAppend, CherGetTime`;%CherGetTime%`n , %WorkingDir%Cher.csv return */ ;==========================================================================================; ButtonVLCtestCom: InputBox, HlpVLC, type VLC comand, "space/t/get_time/..." ControlGet, vlcHwnd, hwnd, , ToolbarWindow321, VLC media player ControlSend, , %HlpVLC%, ahk_id %vlcHwnd% msgbox, ButtonVLCtestCom timeout return ; Buttonstart: ; start VLC & film IfWinExist, VLC WinClose, VLC ; put your own path and film runwait, %WorkingDir%#VLC\Exec\VLCPortable.exe %WorkingDir%#film\2007_0717Lefkas0261.AVI Return ; ButtonFinish: ;===close VLC==== IfWinExist, VLC WinClose, VLC MsgBox, 4, , Finish = Yes restart = No ; 'new' video or finish IfMsgBox, Yes GuiClose: ExitApp return ; ButtonPauzeOnOff: ;----Pauze/Play -- {space} ControlGet, vlcHwnd, hwnd, , ToolbarWindow321, VLC media player ControlSend, , {space}, ahk_id %vlcHwnd% If PauzeH = Pauze-ON PauzeH = Pauze-OFF Else PauzeH = Pauze-ON GuiControl, Text, PauzeOnOff, %PauzeH% return