Guest User

Untitled

a guest
Sep 16th, 2011
295
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.46 KB | None | 0 0
  1. MP3TAG-EXPORT SKRIPT!!!!!!!!!!!!!!!!!!!!!
  2.  
  3. $filename(C:\lyrics.txt,utf-8)$loop(%_path%)$if($or(%unsyncedlyrics%,%syncedlyrics%),$if(%unsyncedlyrics%,---------UNSYNCED---------
  4. %_filename%
  5. $regexp(%unsyncedlyrics%,'^\w{2,5}\|\|(.+)',\1)
  6. ---------END OF LYRICS---------
  7. ,)$if(%syncedlyrics%,---------SYNCED---------
  8. %_filename%
  9. %syncedlyrics%
  10. ---------END OF LYRICS---------
  11. ,),)$loopend()---------END OF FILE---------
  12.  
  13. AHK SKRIPT!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  14.  
  15. #NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
  16. SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
  17. SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
  18.  
  19.  
  20.  
  21. Gui, Add, Text, x66 y27 w290 h30 +Center, Please specify the location of your lyrics-file here:`n(has to include full path and file name)
  22. Gui, Add, Edit, x66 y67 w290 h20 vSource, C:\lyrics_export.txt
  23. Gui, Add, Button, x226 y167 w130 h30 gCancel, Cancel
  24. Gui, Add, Progress, x66 y207 w290 h20 vprogress, 0
  25. Gui, Add, Button, x66 y167 w130 h30 Default gStart, Start Process
  26. Gui, Add, Text, x66 y97 w290 h30 +Center, Please specify your output folder here:`n(absolute path, will be created if not existing)
  27. Gui, Add, Edit, x66 y137 w290 h20 vTarget, C:\lyrics
  28. ; Generated using SmartGUI Creator 4.0
  29. Gui, Show, h261 w419, MP3Tag Lyrics Splitter
  30. Return
  31.  
  32. Cancel:
  33. ExitApp
  34.  
  35. GuiClose:
  36. ExitApp
  37.  
  38. Start:
  39. {
  40. Gui, submit, nohide
  41. FileCreateDir, %Target%
  42. ; count lines in file (by SKAN) --start
  43. FileRead, f1, %Source%
  44. StringReplace,OutputVar,f1,`n,`n,useerrorlevel
  45. count:=ErrorLevel + 1
  46. ; count lines in file (by SKAN) --end
  47. guicontrol, +Range0-%count%, progress
  48. position := 1
  49. heading := 1
  50.  
  51. loop
  52. {
  53. if heading = 1
  54. {
  55. filereadline, param, %Source%, position
  56. if param = ---------UNSYNCED---------
  57. {
  58. ext := "txt"
  59. }
  60. if param = ---------SYNCED---------
  61. {
  62. ext := "lrc"
  63. }
  64. if param = ---------END OF FILE---------
  65. {
  66. MsgBox,, Job finished, Done!
  67. IfMsgBox, OK
  68. ExitApp
  69. }
  70. position++
  71. filereadline, title, %Source%, position
  72. fileappend,, %target%\%title%.%ext%, utf-8
  73. heading := 0
  74. position++
  75. }
  76. else
  77. {
  78. filereadline, line, %Source%, position
  79. if line = ---------END OF LYRICS---------
  80. {
  81. heading:= 1
  82. position++
  83. }
  84. else
  85. {
  86. filereadline, line, %Source%, position
  87. fileappend, %line%`n, %target%\%title%.%ext%
  88. position++
  89. }
  90. }
  91. guicontrol,, progress, %position%
  92. }
  93.  
  94. }
Advertisement
Add Comment
Please, Sign In to add comment