-
Notifications
You must be signed in to change notification settings - Fork 2
/
Music Videos NFO creator (GUI).ahk
70 lines (54 loc) · 1.21 KB
/
Music Videos NFO creator (GUI).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
59
60
61
62
63
64
65
66
67
68
69
70
; #NoEnv
SetWorkingDir %A_ScriptDir%
#singleInstance, Force
#persistent
Gui, +AlwaysOnTop
Gui, Add, Text,, Enter Subfolder Name:
Gui, Add, Edit, vsub w200
Gui, Add, Text,, Enter Genre:
Gui, Add, Edit, vgen w200
Gui, Add, Text,, Enter Default Year:
Gui, Add, Edit, vyear w200
Gui, Add, Button, Default w+100, OK
Gui, Add, Button, x+20 w+100, Cancel
Gui, Show,, Music Videos NFO Creator
return
ButtonOK:
Gui, Submit, nohide
IF sub =
{
MsgBox, 4096, ,Sub Cant be Empty!
}
SubFolder := sub
Path := A_ScriptDir . "\" . SubFolder
IF Path = A_ScriptDir . "\"
{
MsgBox, 4096, ,Error Path! %path%
ExitApp
}
Loop, %Path%\*.*,1,0 ; loop through all folder in emuPath
{
SplitPath, A_LoopFileFullPath, name, Path, ext, name_no_ext,
MyArray := StrSplit(name_no_ext, " - ")
Var1 := % MyArray[1]
Var2 := % MyArray[2]
TextBlock =
(
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<musicvideo>
<track></track>
<title>%Var2%</title>
<artist>>%Var1%</artist>
<album></album>
<genre>%gen%</genre>
<year>%year%</year>
</musicvideo>
)
if ext in mkv,avi,mp4,mpg,mpeg,m2v,ts,ogm,wmv,mov,asf,ram,rm,flv
FileAppend, %TextBlock%, %Path%\%name_no_ext%.nfo, CP65001
}
MsgBox, 4096, ,Finished!
Return
GuiClose:
ButtonCancel:
ExitApp