Sign in to follow this  
Followers 0
10031992

Code Rename .mp3

10 posts in this topic

I'm trying to make a little program, actually a utility, I'm almost done (I think hehe), I'm trying to make the button open the file Certain type (. mp3) They open after the file, Which Will display the file in "GUICtrlCreateList" Being selected and after, you must select the name in "GUICtrlCreateCombo" and that is What I Am and I Can not HAVING the

After Selecting BOTH, the song "GUICtrlCreateList" and the name "GUICtrlCreateCombo" and he renames the music for That name That Was selected by the. "mp3", But not know of any not found and examples of this.

If anyone knows and me Can Help.


-------------------------------------------------------------------------------------------------------------------------------------------- [center][/center][center]Autoit Support Forum in Portuguese | AutoitBrasil.com[/center] [sub]My Script :[/sub]Simples Login for Program

Share this post


Link to post
Share on other sites



#3 ·  Posted (edited)

Here is an example of what I'm talking

Let me see if I can explain better

"I'm having to make a utility to rename the "Songs" selected within the "GUICtrlCreateList" shall go be renamed to the name that is within the "GUICtrlCreateCombo" when you click the button "Save Music"

code exemple

#include <ButtonConstants.au3>
#include <ComboConstants.au3>
#include <GUIConstantsEx.au3>
#include <GUIListBox.au3>
#include <StaticConstants.au3>
#include <TabConstants.au3>
#include <WindowsConstants.au3>





$MsgOpt = 'choose the songs'
$SMUSICA = 'SALVe music'
$AMUSICA = 'OPEN MUSIC'
$M1 = 'name 1'
$M2 = 'name 2'
$M3 = 'name 3'
$M4 = 'name 4'



#Region ### START Koda GUI section ### Form=C:\Users\CHAPA\Desktop\MU Sound\Koda\Form1.kxf
$Form1 = GUICreate("Mu Sound Make", 401, 340, 317, 226)
$Button1 = GUICtrlCreateButton($AMUSICA, 288, 296, 97, 33, $WS_GROUP)
GUICtrlSetTip(-1,"Selecione sua Musica","Musica")
$List1 = GUICtrlCreateList("", 16, 176, 369, 110)
$Label3 = GUICtrlCreateLabel("Musicas:", 16, 160, 46, 17)
$Tab1 = GUICtrlCreateTab(8, 8, 385, 329)
GUICtrlSetResizing(-1, $GUI_DOCKWIDTH+$GUI_DOCKHEIGHT)
GUICtrlCreateTabItem("")
$Label1 = GUICtrlCreateLabel("Maps: ", 24, 24, 36, 17)
$Combo1 = GUICtrlCreateCombo("-Default-", 32, 48, 145, 25)
GUICtrlSetTip(-1,"Selecione o MUSICA desejado","MUSICA")
$w0 = GUICtrlSetData(-1,$M1)
$w1 = GUICtrlSetData(-1,$M2)
$w3 = GUICtrlSetData(-1,$M3)
$w4 = GUICtrlSetData(-1,$M4)

$Label2 = GUICtrlCreateLabel("Ex: NAME 1 , NAME 2 ...", 32, 72, 109, 17)
$Button2 = GUICtrlCreateButton($SMUSICA, 288, 16, 99, 33, $WS_GROUP)
GUICtrlSetTip(-1,"Salvar Alteração","Musica")
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###







While 1
$nMsg = GUIGetMsg()
Switch $nMsg
    Case $Button1
        $EscolhaMusica = FileOpenDialog($MsgOpt,@DesktopDir & "","Musicas (*.Mp3)",1 + 4)
        $Seleciona = FileRead($EscolhaMusica,1)
        If @error = -1 Then ExitLoop
        $List1 = $Seleciona

Case $GUI_EVENT_CLOSE
Exit

EndSwitch
WEnd
Edited by 10031992

-------------------------------------------------------------------------------------------------------------------------------------------- [center][/center][center]Autoit Support Forum in Portuguese | AutoitBrasil.com[/center] [sub]My Script :[/sub]Simples Login for Program

Share this post


Link to post
Share on other sites

Completly Guessing here but is this what you want?

#include <ButtonConstants.au3>
#include <ComboConstants.au3>
#include <GUIConstantsEx.au3>
#include <GUIListBox.au3>
#include <StaticConstants.au3>
#include <TabConstants.au3>
#include <WindowsConstants.au3>





$MsgOpt = 'choose the songs'
$SMUSICA = 'SALVe music'
$AMUSICA = 'OPEN MUSIC'
$M1 = 'name 1'
$M2 = 'name 2'
$M3 = 'name 3'
$M4 = 'name 4'



#Region ### START Koda GUI section ### Form=C:\Users\CHAPA\Desktop\MU Sound\Koda\Form1.kxf
$Form1 = GUICreate("Mu Sound Make", 401, 340, 317, 226)
$Button1 = GUICtrlCreateButton($AMUSICA, 288, 296, 97, 33, $WS_GROUP)
GUICtrlSetTip(-1,"Selecione sua Musica","Musica")
$List1 = GUICtrlCreateList("", 16, 176, 369, 110)
$Label3 = GUICtrlCreateLabel("Musicas:", 16, 160, 46, 17)
$Tab1 = GUICtrlCreateTab(8, 8, 385, 329)
GUICtrlSetResizing(-1, $GUI_DOCKWIDTH+$GUI_DOCKHEIGHT)
GUICtrlCreateTabItem("")
$Label1 = GUICtrlCreateLabel("Maps: ", 24, 24, 36, 17)
$Combo1 = GUICtrlCreateCombo("-Default-", 32, 48, 145, 25)
GUICtrlSetTip(-1,"Selecione o MUSICA desejado","MUSICA")
$w0 = GUICtrlSetData(-1,$M1)
$w1 = GUICtrlSetData(-1,$M2)
$w3 = GUICtrlSetData(-1,$M3)
$w4 = GUICtrlSetData(-1,$M4)

$Label2 = GUICtrlCreateLabel("Ex: NAME 1 , NAME 2 ...", 32, 72, 109, 17)
$Button2 = GUICtrlCreateButton($SMUSICA, 288, 16, 99, 33, $WS_GROUP)
GUICtrlSetTip(-1,"Salvar Alteração","Musica")
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $Button1
            $EscolhaMusica = FileOpenDialog($MsgOpt,@DesktopDir & "","Musicas (*.Mp3)",1 + 4)
            $Seleciona = StringTrimLeft($EscolhaMusica, StringInStr($EscolhaMusica, "|"))
            $Seleciona = StringSplit($Seleciona,'|')
            $OringinalDir = StringTrimRight($EscolhaMusica, (StringLen($EscolhaMusica) - StringInStr($EscolhaMusica, "|"))+1)
            If @error Then
                MsgBox(4096,"","No File(s) chosen")
            Else
                For $i = 1 to $Seleciona[0]
                    GUICtrlSetData($List1, $Seleciona[$i])
                Next
            EndIf
        Case $Button2
            $NewDir = FileSelectFolder("Save Music Where?", @DesktopDir & "\")
            For $i = 1 to $Seleciona[0]
                FileCopy($OringinalDir & "\" & $Seleciona[$i], $NewDir & "\" & GUICtrlRead($Combo1) & $i & ".mp3", 1) ; Or FileMove
            Next
        Case $GUI_EVENT_CLOSE
            Exit
    EndSwitch
WEnd

Share this post


Link to post
Share on other sites

I tested here and it selects the music correctly, but does not save or rename the music with the chosen name.

Thank you friend, you're helping me a lot


-------------------------------------------------------------------------------------------------------------------------------------------- [center][/center][center]Autoit Support Forum in Portuguese | AutoitBrasil.com[/center] [sub]My Script :[/sub]Simples Login for Program

Share this post


Link to post
Share on other sites

I think one of these lines is not sure, maybe they do not think the names when selected and confirmed by Button2

Case $Button2
            $NewDir = FileSelectFolder("Save Music Where?", @DesktopDir & "\")
            For $i = 1 to $Seleciona[0]
                FileCopy($OringinalDir & "\" & $Seleciona[$i], $NewDir & "\" & GUICtrlRead($Combo1) & $i & ".mp3", 1) ; Or FileMove
            Next
        Case $GUI_EVENT_CLOSE
            Exit
    EndSwitch
WEnd

I found a code to rename files, I took a look but do not know if I could add this code the other

#include <File.au3>
$PATH = FileSelectFolder("SELECT","")
$FILE = _FileListToArray($PATH,"*.MP3",1)
If IsArray($FILE) Then
ProgressOn("M3U Rename","Rename ...")
For $INDEX = 1 To $FILE[0]
    $NAME = StringReplace($FILE[$INDEX],"Imported M93 playlists -","")
    FileMove($PATH & "\" & $FILE[$INDEX],$PATH & "\" & $NAME)
    ProgressSet(Int($INDEX*100/$FILE[0]),$FILE[$INDEX])
    Sleep(1000)
Next
ProgressOff()
EndIf

-------------------------------------------------------------------------------------------------------------------------------------------- [center][/center][center]Autoit Support Forum in Portuguese | AutoitBrasil.com[/center] [sub]My Script :[/sub]Simples Login for Program

Share this post


Link to post
Share on other sites

#9 ·  Posted (edited)

Did not work here friend, do not rename the music selected and saved the music .

I'll try here to see if something can

Summary:

The music is not rename (For the selected name) and saved

Excuse my english is terrible

Edited by 10031992

-------------------------------------------------------------------------------------------------------------------------------------------- [center][/center][center]Autoit Support Forum in Portuguese | AutoitBrasil.com[/center] [sub]My Script :[/sub]Simples Login for Program

Share this post


Link to post
Share on other sites

I tried here with this but also did not work, not saving the song with the name renamed


-------------------------------------------------------------------------------------------------------------------------------------------- [center][/center][center]Autoit Support Forum in Portuguese | AutoitBrasil.com[/center] [sub]My Script :[/sub]Simples Login for Program

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0