AutoHotkeyを学ぶきっかけになったVLCを利用した文字起こし支援ソフトVLC Transcriber and Timer ですが,”VT”と名前を変えて,よりノンプログラマーのユーザーに使いやすい形に変えています.
ちょっとだけできましたので,みなさんにコードをシェアします.AutoHotkeyでVLCを使いながら文字起こししている人(そんな人いるのか?)も,そうではない人も,これを機につかってみてください.
動作に必要なものは,
- AutoHotkey
- VLCMedia Player
の2つです.(Googleで検索してください.) ダウンロード→インストールしておきます.
1.AutoHotkeyのファイル(firsttime.ahk)を,右クリックのメニューから作成し,Edit Scriptでメモ帳から開きます.次に,以下のコード1を貼り付けます.ダブルクリックで実行します.(keysetting.iniというファイルが作成されます.)
2.次に,AutoHotkeyのファイル(vt.ahk)を作成し,Edit Scriptからメモ帳で開き,以下のコード2を貼りつけます.
3.保存して,ダブルクリックで起動です.
- 他のプログラムに焦点が当たっていても,F1~F3(デフォルト)でVLCを操作できます.
- ワードなどと一緒に利用し,文字起こしをしてください.
- お好みのキーに変えたい場合は,Iniファイルをいじるか,UIのHotkey Settingで変更できます.
- 無料で使えます.
;コード1 /* script written by neokix (@neo_kix) website and source code: https://neokixblog.wordpress.com/ */ #NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases. ; #Warn ; Enable warnings to assist with detecting common errors. SendMode Input ; Recommended for new scripts due to its superior speed and reliability. SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory. #SingleInstance, Force IniWrite, F1, keysetting.ini, skipbackward, IniWrite, F3, keysetting.ini, skipforward, IniWrite, F2, keysetting.ini, start_stop, IniWrite, VLC, keysetting.ini, player, return
;コード2 /* script written by neokix (@neo_kix) website and source code: https://neokixblog.wordpress.com/ */ #NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases. ; #Warn ; Enable warnings to assist with detecting common errors. SendMode Input ; Recommended for new scripts due to its superior speed and reliability. SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory. #SingleInstance, Force Gui, maingui: New, +AlwaysOnTop Gui, maingui: Font, S12, Meiryo, Gui, maingui: Add, Text, ,WELCOME! Gui, maingui: Add, Button, ghotkeyset, Hotkey Setting Gui, maingui: Add, Button, gcurrentsetting, Current Hotkey Gui, maingui: Add, Button, gplayer, Default Player Setting Gui, maingui: Show, x50 y50 Iniread, kstartstop, keysetting.ini, start_stop, %kstartstop%, Iniread, kskipforward, keysetting.ini, skipforward, %kskipforward%, Iniread, kskipbackward, keysetting.ini, skipbackward, %kskipbackward%, Iniread, vplayer, keysetting.ini, player, SetTitleMatchMode, 2 ;;;;;;;;;;;;;;;;; ;;;vlc control;;; ;;;;;;;;;;;;;;;;; Hotkey, %kstartstop%, lstartstop, Hotkey, %kskipforward%, lskipforward, Hotkey, %kskipbackward%, lskipbackward, return lstartstop: controlsend, , {Space}, %vplayer% return lskipforward: controlsend, , +{right}, %vplayer% return lskipbackward: controlsend, , +{left}, %vplayer% return currentsetting: Msgbox, Your Current Setting is: `n`n[Start/Stop]= %kstartstop% `n [Forward]=%kskipforward% `n [Back]= %kskipbackward% `n [PLAYER]=%vplayer% `n`nThese Hotkeys are replacable. Visit "Hotkey Setting". `n`n return player: InputBox, vplayer, Player Setting, Enter Your Player`n *Experimental Function: "VLC" Only ; ListBox, If (vplayer = null) { Iniread, vplayer, keysetting.ini, player, Msgbox, , ,Canceled `nCurrent Player is %vplayer%, 2 } else { IniDelete, keysetting.ini, player IniWrite, %vplayer%, keysetting.ini, player, Sleep, 100 Msgbox, , ,%vplayer% is registered as your default player, 2 Reload } return hotkeyset: Gui, hotkeyset: New, +AlwaysOnTop Gui, hotkeyset: Add, Text, ,"Start/Stop" Gui, hotkeyset: Add, Hotkey, ,kstartstop, %kstartstop% Gui, hotkeyset: Add, Text, ,"Skip Forward" Gui, hotkeyset: Add, Hotkey, ,kskipforward, %kskipforwad% Gui, hotkeyset: Add, Text, ,"Skip Backward" Gui, hotkeyset: Add, Hotkey, ,kskipbackward, %kskipbackward% Gui, hotkeyset: Add, Button, gsubmitkey, Submit Gui, hotkeyset: Show, return submitkey: GuiControlGet, kstartstop, ,msctls_hotkey321 GuiControlGet, kskipforward, ,msctls_hotkey322 GuiControlGet, kskipbackward, ,msctls_hotkey323 Sleep, 100 If (kstartstop = null) { tooltip, missing start/stop } else { IniDelete, keysetting.ini, start_stop IniWrite, %kstartstop%, keysetting.ini, start_stop, } Sleep, 100 If (kskipforward = null) { tooltip, missing skipforward } else { IniDelete, keysetting.ini, skipforward IniWrite, %kskipforward%, keysetting.ini, skipforward, } Sleep, 100 If (kskipbackward = null) { tooltip, missing skipbackward } else { IniDelete, keysetting.ini, skipbackward IniWrite, %kskipbackward%, keysetting.ini, skipbackward, } tooltip, Sleep, 100 Reload return GuiClose: Gui, Destroy ExitApp return