時間測ると貼り付け君

*倉庫では,作ってみたお役立ち?ソフトを公開しています.

「時間測ると貼り付け君」は,

  1. キーボード上のみで,
  2. F1で自ら時間をはかり,
  3. F2/Endで時間を(0.0)形式で貼り付けることができる

プログラムです.

いつ使うねん!という話ですが,例えば文字起こしなどで10秒以下を計測し,それをそのまま時間数として貼り付けたい際に使えます.10秒以上は手入力で10の位を付けてください.

改良すれば,(00.00)式などにも用いることができます.

automated tikmestamps

F1で計測し,F2 で貼り付ける,マウスは必要ない.

.exeファイルはこちらから.

https://dl.dropboxusercontent.com/u/85699252/Just%20Timer.exe

.ahkは,以下のソースコードからご利用ください.

/*
Just Timer neokix 20170315

Reminder
Window Key-> #
Ctrl Key -> ^
Alt Key -> !
*/

#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.

;; Millisecond Timer

 AdjTime = 0
 
;Timer GUI
 Gui , Timer:Font , s8, Segoe UI
 Gui , Timer:Add , Text, x10 y10, Just Timer
 Gui , Timer:Font , s25, Segoe UI
 Gui , Timer:Add , Text , Center w350 , 00:00:00:000
 Gui , Timer:Font , s10, Segoe UI
 Gui , Timer:Add , Button , x20 y100 w100 gStop Section , Stop
 Gui , Timer:Add , Button , x20 y100 w100 gStart , Start
; Gui , Timer:Add , Button , w110 ys gCopy, Copy
 Gui , Timer:Add , Button , w110 ys gReset , Reset
 Gui , Timer:Add , Button , w110 ys gHelp , Help
 Gui , Timer:Add , Button , x320 y7 w50 gExit , Exit
 Gui , Timer:+AlwaysOnTop
 Gui , Timer:Color, White
 Gui , Timer:Show , x1530 y700, Timer
 Control , Hide , , Button1 , Timer

/* 
; Starting VLC
IfWinExist ahk_class QWidget
 Return
Else
{
 Sleep, 200
 Run , C:\Program Files (x86)\VideoLAN\VLC\vlc.exe
 Return
}
Exit
*/


; Hotkeys
#IfWinExist Timer
F1::
F12::
SetTitleMatchMode, 2
GoSub, Start
return

#IfWinExist Timer
F12 Up::
F1 Up::
SetTitleMatchMode, 2
GoSub, Stop
return

;;Timestamp ex. (2.5)
#IfWinExist Timer
F2::
End::
SetTitleMatchMode, 2
GoSub, Copy
Return

Start:
 Control , Hide , , Button2 , Timer
 Control , Show , , Button1 , Timer
 GuiControl , Focus , Button1
 StopClock = 0 
 ControlGetText , DisplayTime , Static2
 ST := A_TickCount ; Start Time
 While StopClock = 0
 ControlSetText , Static2 , % FormatCT((A_TickCount - ST) + AdjTime)
 StopClock = 0
 Exit
 
Stop:
Reset:
 Control , Show , , Button2 , Timer
 Control , Hide , , Button1 , Timer
 GuiControl , Focus , Button2
 StopClock = 1
 IF (A_ThisLabel = "Reset")
 {
 AdjTime = 0
 ControlSetText , Button2 , Start
 ControlSetText , Static2 , 00:00:00:000
 }else{
 AdjTime := 0
 ControlSetText , Button2 , Restart
 }

 Exit
 
Copy:
 ControlGetText , Clipboard , Static2
;; MsgBox, 262192, Time Copied to Clipboard, Copied to Clipboard: %Clipboard%, 2
 Sleep, 50
 Send, {(}
 Sleep, 50
 Send, ^v
 Sleep, 50
 Send, {Backspace 2}
 Sleep, 50
 Send, {Left}
 Sleep, 50
 Send, {Backspace}
 Sleep, 50
 Send, {NumpadDot}
 Sleep, 50
 Send, {Left 2}
 Sleep, 50
 Send, {BackSpace 7}
 Sleep, 50
 Send, {Right 3}
 Sleep, 50
 Send, {)}
 Exit

Help:
 msgbox, "このプログラムの終了は[X]ではなく[Exit]を利用してください. `n 一時停止·再開は[ScrollLock]を押してください.`n <タイマー操作> `n F1/F12押し離し→開始/終了 `n F2/End→(0.0)式タイムスタンプ挿入 `n `n Thanks to Cruncher1(https://autohotkey.com/board/topic/97904-simple-millisecond-timer-stopwatch/) for base codes and the icon is created by WAYVO(Clock, electronic, time icon | Icon search engine : https://www.iconfinder.com/icons/811483/clock_electronic_time_icon#size=128)`n "
 return
 
Exit:
 ExitApp

TimerGuiClose:
 Winminimize
 
FormatCT(ms) ; Formats milliseconds into 00:00:00:000 (last three digits are milliseconds)
{
 StringRight , mil , ms , 3
 StringTrimRight , sec , ms , 3
 min := Floor(sec/60)
 sec := sec-(min*60)
 hrs := Floor(min/60)
 min := min-(hrs*60)
 While StrLen(sec) <> 2
 sec := "0" . sec
 While StrLen(mil) <> 3
 mil := "0" . mil
 While StrLen(min) <> 2
 min := "0" . min
 While StrLen(hrs) <> 2
 hrs := "0" . hrs 
 return , hrs . ":" . min . ":" . sec . ":" . mil
}

/*
CONTROL
*/

;Suspend Shortcuts
ScrollLock::Suspend

;Exit App
^!w::
Send, ExitApp
Return