-
Notifications
You must be signed in to change notification settings - Fork 72
/
class_CmdLine.ahk
60 lines (41 loc) · 1.06 KB
/
class_CmdLine.ahk
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
/**
Class:
CmdLine.ahk - Utility class for running cmdline utils.
Version:
v1.0.0
Requirements:
AutoHotkey v1.1.21.00+
Usage:
inputFile := "../myfile.mp4"
outputFile := "../cut_myfile.mp4"
fromTime := "00:10"
toTime := "00:31"
cmd := new CmdLine("ffmpeg.exe")
cmd.AddParam("-ss", fromTime)
cmd.AddParam("-i", inputFile)
cmd.AddParam("-c", "copy")
cmd.AddFlag("-copyts")
cmd.AddParam("-to", toTime)
cmd.AddFlag(outputFile)
cmd.Execute()
Links:
Github - https://github.com/sidola/AHK-Utils
*/
class CmdLine {
__New(programPath) {
this.programPath := programPath
this.flagsAndParams := ""
}
AddFlag(flag) {
this.flagsAndParams .= Format(" {}", flag)
}
AddParam(key, value) {
this.flagsAndParams .= Format(" {} {}", key, value)
}
GetCommand() {
return Format("{}{}", this.programPath, this.flagsAndParams)
}
Execute(workingDir := "", minMaxHide := "") {
RunWait, % this.GetCommand(), %workingDir%, %minMaxHide%
}
}