Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- MP3TAG-EXPORT SKRIPT!!!!!!!!!!!!!!!!!!!!!
- $filename(C:\lyrics.txt,utf-8)$loop(%_path%)$if($or(%unsyncedlyrics%,%syncedlyrics%),$if(%unsyncedlyrics%,---------UNSYNCED---------
- %_filename%
- $regexp(%unsyncedlyrics%,'^\w{2,5}\|\|(.+)',\1)
- ---------END OF LYRICS---------
- ,)$if(%syncedlyrics%,---------SYNCED---------
- %_filename%
- %syncedlyrics%
- ---------END OF LYRICS---------
- ,),)$loopend()---------END OF FILE---------
- AHK SKRIPT!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
- #NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
- SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
- SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
- 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)
- Gui, Add, Edit, x66 y67 w290 h20 vSource, C:\lyrics_export.txt
- Gui, Add, Button, x226 y167 w130 h30 gCancel, Cancel
- Gui, Add, Progress, x66 y207 w290 h20 vprogress, 0
- Gui, Add, Button, x66 y167 w130 h30 Default gStart, Start Process
- Gui, Add, Text, x66 y97 w290 h30 +Center, Please specify your output folder here:`n(absolute path, will be created if not existing)
- Gui, Add, Edit, x66 y137 w290 h20 vTarget, C:\lyrics
- ; Generated using SmartGUI Creator 4.0
- Gui, Show, h261 w419, MP3Tag Lyrics Splitter
- Return
- Cancel:
- ExitApp
- GuiClose:
- ExitApp
- Start:
- {
- Gui, submit, nohide
- FileCreateDir, %Target%
- ; count lines in file (by SKAN) --start
- FileRead, f1, %Source%
- StringReplace,OutputVar,f1,`n,`n,useerrorlevel
- count:=ErrorLevel + 1
- ; count lines in file (by SKAN) --end
- guicontrol, +Range0-%count%, progress
- position := 1
- heading := 1
- loop
- {
- if heading = 1
- {
- filereadline, param, %Source%, position
- if param = ---------UNSYNCED---------
- {
- ext := "txt"
- }
- if param = ---------SYNCED---------
- {
- ext := "lrc"
- }
- if param = ---------END OF FILE---------
- {
- MsgBox,, Job finished, Done!
- IfMsgBox, OK
- ExitApp
- }
- position++
- filereadline, title, %Source%, position
- fileappend,, %target%\%title%.%ext%, utf-8
- heading := 0
- position++
- }
- else
- {
- filereadline, line, %Source%, position
- if line = ---------END OF LYRICS---------
- {
- heading:= 1
- position++
- }
- else
- {
- filereadline, line, %Source%, position
- fileappend, %line%`n, %target%\%title%.%ext%
- position++
- }
- }
- guicontrol,, progress, %position%
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment