Jump to content

My FLV merger program help


jercfd
 Share

Recommended Posts

I have several questions about how to make my program. I already got most of it done.

1. what is the variable for "C:\Documents and Settings\{User Name}\"

2. How do you convert a read only textbox into a writable textbox when a checkbox is checked and make the textbox read only again after the checkbox is unchecked?

3. How do you fix the runwait command at the end of my script?

external files avaliable from here

http://www.ayanray.com/blog/tags/FLV

#include <GUIConstants.au3>

#Region ### START Koda GUI section ### Form=Koda Data.kxf\FLV Merger\Koda Data.kxf
$Form1 = GUICreate("FLV Merger", 593, 367, 193, 125)
$CombineGroup = GUICtrlCreateGroup(" FLV files to combine ", 20, 20, 552, 200)
$Input1 = GUICtrlCreateInput("", 40, 40, 440, 21)
$Input2 = GUICtrlCreateInput("", 40, 70, 440, 21)
$Input3 = GUICtrlCreateInput("", 40, 100, 440, 21)
$Input4 = GUICtrlCreateInput("", 40, 130, 440, 21)
$Input5 = GUICtrlCreateInput("", 40, 160, 440, 21)
$Input6 = GUICtrlCreateInput("", 40, 190, 440, 21)
$Browse1 = GUICtrlCreateButton("Browse...", 485, 40, 67, 21, 0)
$Browse2 = GUICtrlCreateButton("Browse...", 485, 70, 67, 21, 0)
$Browse3 = GUICtrlCreateButton("Browse...", 485, 100, 67, 21, 0)
$Browse4 = GUICtrlCreateButton("Browse...", 485, 130, 67, 21, 0)
$Browse5 = GUICtrlCreateButton("Browse...", 485, 160, 67, 21, 0)
$Browse6 = GUICtrlCreateButton("Browse...", 485, 190, 67, 21, 0)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Options = GUICtrlCreateGroup(" Options ", 20, 230, 225, 100)
$Creator = GUICtrlCreateCheckbox("Add Creator Tag to FLV metadata", 40, 250, 185, 25)
$CreatorTag = GUICtrlCreateInput("", 40, 300, 185, 21)
;$CreatorTag = GUICtrlCreateInput("", 40, 300, 185, 21, $ES_READONLY, $WS_EX_STATICEDGE)
$Label1 = GUICtrlCreateLabel("File Creator Name", 40, 280, 88, 17)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Merge = GUICtrlCreateButton("Merge FLV Files", 265, 290, 285, 40, 0)
GUICtrlSetFont(-1, 12, 400, 0, "Comic Sans MS")
$Save = GUICtrlCreateInput("", 265, 248, 215, 21)
$SaveBrowse = GUICtrlCreateButton("Browse...", 485, 248, 65, 21, 0)
$Label2 = GUICtrlCreateLabel("Save Location", 265, 230, 73, 17)
$FileMenu = GUICtrlCreateMenu("&File")
$Combine = GUICtrlCreateMenuItem("Combine FLV Files", $FileMenu)
$Close = GUICtrlCreateMenuItem("&Exit", $FileMenu)
$HelpMenu = GUICtrlCreateMenu("&Help")
$Help = GUICtrlCreateMenuItem("&View Help", $HelpMenu)
$AboutMenu = GUICtrlCreateMenu("&About")
$About = GUICtrlCreateMenuItem("About This &Program", $AboutMenu)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
Switch GUIGetMsg()
   Case $GUI_EVENT_CLOSE
      Exit
  ;File Menu
   Case $Combine
   Case $Close
      Exit
  ;Help Menu
   Case $Help
      Msgbox(64, "Help", "Help - How to use" & @LF & @LF & @LF & "1. Select the FLV files you would like to combine into one single FLV file." & @LF & @LF & "2. Optionaly, you can select if you want to add the name of the creator." & @LF & @LF & "3. Select the location you would like to save the FLV file." & @LF & @LF & "4. Press the 'Merge FLV Files' button." & @LF & @LF & "5. Go to the location where you saved your FLV file and enjoy watching it!")
  ;About Menu
   Case $About
      Msgbox(0, "About", "This program was designed to combine FLV files into one single file. It uses programs made and designed by 'ASM' and 'Ingo Oppermann'. All work is credited to them. This GUI was desgined by DUNDUA. Please note that I nor 'ASM' and 'Ingo Oppermann' are responsible if it causes any damage or if it doesn't work.")
  ;File Inputs
   Case $Browse1
      $path1 = FileOpenDialog("Select a FLV file to combine", "::{450D8FBA-AD25-11D0-98A8-0800361B1103}", "FLV Files (*.flv)", 1 + 2 )
      If @error Then
         MsgBox(16,"Error","No File chosen")
      Else
         $path1 = StringReplace($path1, "|", @CRLF)
         MsgBox(64,"File Choosen","You have selected: " & $path1)
         GUICtrlSetData ($Input1, $path1 )
      EndIf
   Case $Browse2
      $path2 = FileOpenDialog("Select a FLV file to combine", "::{450D8FBA-AD25-11D0-98A8-0800361B1103}", "FLV Files (*.flv)", 1 + 2 )
      If @error Then
         MsgBox(16,"Error","No File chosen")
      Else
         $path2 = StringReplace($path2, "|", @CRLF)
         MsgBox(64,"File Choosen","You have selected: " & $path2)
         GUICtrlSetData ($Input2, $path2 )
      EndIf
   Case $Browse3
      $path3 = FileOpenDialog("Select a FLV file to combine", "::{450D8FBA-AD25-11D0-98A8-0800361B1103}", "FLV Files (*.flv)", 1 + 2 )
      If @error Then
         MsgBox(16,"Error","No File chosen")
      Else
         $path3 = StringReplace($path3, "|", @CRLF)
         MsgBox(64,"File Choosen","You have selected: " & $path3)
         GUICtrlSetData ($Input3, $path3 )
      EndIf
   Case $Browse4
      $path4 = FileOpenDialog("Select a FLV file to combine", "::{450D8FBA-AD25-11D0-98A8-0800361B1103}", "FLV Files (*.flv)", 1 + 2 )
      If @error Then
         MsgBox(16,"Error","No File chosen")
      Else
         $path4 = StringReplace($path4, "|", @CRLF)
         MsgBox(64,"File Choosen","You have selected: " & $path4)
         GUICtrlSetData ($Input4, $path4 )
      EndIf
   Case $Browse5
      $path5 = FileOpenDialog("Select a FLV file to combine", "::{450D8FBA-AD25-11D0-98A8-0800361B1103}", "FLV Files (*.flv)", 1 + 2 )
      If @error Then
         MsgBox(16,"Error","No File chosen")
      Else
         $path5 = StringReplace($path5, "|", @CRLF)
         MsgBox(64,"File Choosen","You have selected: " & $path5)
         GUICtrlSetData ($Input5, $path5 )
      EndIf
   Case $Browse6
      $path6 = FileOpenDialog("Select a FLV file to combine", "::{450D8FBA-AD25-11D0-98A8-0800361B1103}", "FLV Files (*.flv)", 1 + 2 )
      If @error Then
         MsgBox(16,"Error","No File chosen")
      Else
         $path6 = StringReplace($path6, "|", @CRLF)
         MsgBox(64,"File Choosen","You have selected: " & $path6)
         GUICtrlSetData ($Input6, $path6 )
      EndIf
  ;Save Location
   Case $SaveBrowse
      $savelocation = FileSaveDialog ("Select the location to save combined FLV", "::{450D8FBA-AD25-11D0-98A8-0800361B1103}", "FLV Files (*.flv)", 2)
      If @error Then
         MsgBox(16,"Error","No File Save Location")
      Else
         $savelocation = StringReplace($savelocation, "|", @CRLF)
         MsgBox(64,"File Save Location","You want to save here: " & $savelocation & ".flv")
         GUICtrlSetData ($Save, $savelocation & ".flv" )
      EndIf
   Case $Merge
      If $Creator = 1 Then
         $tag = "-c " & $CreatorTag
      Else
         $tag = ""
      EndIf
      RunWait(@ComSpec & " /c " & @scriptdir & "\external\FLVMERGE.exe" & $Input1 & $Input2 & $Input3 & Input4 & Input5 & Input6, "", @SW_HIDE)
      FileMove ( "c.docs and set.user.merge.flv", @scriptdir)
      RunWait(@ComSpec & " /c " & @scriptdir & "\external\yamdi\yamdi.exe -i " & @scriptdir & "merge.flv -o " & $save & $tag, "", @SW_HIDE)
EndSwitch
WEnd
Link to comment
Share on other sites

1. what is the variable for "C:\Documents and Settings\{User Name}\"

@UserProfileDir?

ow do you convert a read only textbox into a writable textbox when a checkbox is checked and make the textbox read only again after the checkbox is unchecked?

Here is an example:

#include <GuiConstants.au3>

$GUI = GUICreate("Toggle Edit 'Read Only'", 300, 200)

$ReadOnlyEdit_CheckBox = GUICtrlCreateCheckbox("Allow to Edit", 20, 40)

$Edit = GUICtrlCreateEdit("Some data", 20, 80, 260, 100, $ES_READONLY)

GUISetState(@SW_SHOW, $GUI)

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
        Case $ReadOnlyEdit_CheckBox
            If GUICtrlRead($ReadOnlyEdit_CheckBox) = $GUI_CHECKED Then
                GUICtrlSendMsg($Edit, $EM_SETREADONLY, False, 0)
            Else
                GUICtrlSendMsg($Edit, $EM_SETREADONLY, True, 0)
            EndIf
    EndSwitch
WEnd

3. How do you fix the runwait command at the end of my script?

What's wrong with it?

Try this maybe:

RunWait(@ComSpec & " /c " & @scriptdir & "\external\yamdi\yamdi.exe -i " & @scriptdir & "\merge.flv -o " & $save & $tag, "", @SW_HIDE)

And you might want to put this at the begining of your script:

Opt("RunErrorsFatal", 0)

(but in the latest betta not needed if i remember correctly).

 

Spoiler

Using OS: Win 7 Professional, Using AutoIt Ver(s): 3.3.6.1 / 3.3.8.1

AutoIt_Rus_Community.png AutoIt Russian Community

My Work...

Spoiler

AutoIt_Icon_small.pngProjects: ATT - Application Translate Tool {new}| BlockIt - Block files & folders {new}| SIP - Selected Image Preview {new}| SISCABMAN - SciTE Abbreviations Manager {new}| AutoIt Path Switcher | AutoIt Menu for Opera! | YouTube Download Center! | Desktop Icons Restorator | Math Tasks | KeyBoard & Mouse Cleaner | CaptureIt - Capture Images Utility | CheckFileSize Program

AutoIt_Icon_small.pngUDFs: OnAutoItErrorRegister - Handle AutoIt critical errors {new}| AutoIt Syntax Highlight {new}| Opera Library! | Winamp Library | GetFolderToMenu | Custom_InputBox()! | _FileRun UDF | _CheckInput() UDF | _GUIInputSetOnlyNumbers() UDF | _FileGetValidName() UDF | _GUICtrlCreateRadioCBox UDF | _GuiCreateGrid() | _PathSplitByRegExp() | _GUICtrlListView_MoveItems - UDF | GUICtrlSetOnHover_UDF! | _ControlTab UDF! | _MouseSetOnEvent() UDF! | _ProcessListEx - UDF | GUICtrl_SetResizing - UDF! | Mod. for _IniString UDFs | _StringStripChars UDF | _ColorIsDarkShade UDF | _ColorConvertValue UDF | _GUICtrlTab_CoverBackground | CUI_App_UDF | _IncludeScripts UDF | _AutoIt3ExecuteCode | _DragList UDF | Mod. for _ListView_Progress | _ListView_SysLink | _GenerateRandomNumbers | _BlockInputEx | _IsPressedEx | OnAutoItExit Handler | _GUICtrlCreateTFLabel UDF | WinControlSetEvent UDF | Mod. for _DirGetSizeEx UDF
 
AutoIt_Icon_small.pngExamples: 
ScreenSaver Demo - Matrix included | Gui Drag Without pause the script | _WinAttach()! | Turn Off/On Monitor | ComboBox Handler Example | Mod. for "Thinking Box" | Cool "About" Box | TasksBar Imitation Demo

Like the Projects/UDFs/Examples? Please rate the topic (up-right corner of the post header: Rating AutoIt_Rating.gif)

* === My topics === *

==================================================
My_Userbar.gif
==================================================

 

 

 

AutoIt is simple, subtle, elegant. © AutoIt Team

Link to comment
Share on other sites

What's wrong with it?

Try this maybe:

RunWait(@ComSpec & " /c " & @scriptdir & "\external\yamdi\yamdi.exe -i " & @scriptdir & "\merge.flv -o " & $save & $tag, "", @SW_HIDE)
still doesn't work

the error says this

Line 132 (File "C:\Documents and Settings\Ming Wu\Desktop\FLV Merger\Copy of FLV Merger.au3"):

RunWait(@ComSpec & " /c " & @scriptdir & "\external\FLVMERGE.exe" & $Input1 & $Input2 & $Input3 & Input4 & Input5 & Input6, "", @SW_HIDE)

RunWait(@ComSpec & " /c " & @scriptdir & "\external\FLVMERGE.exe" & $Input1 & $Input2 & $Input3 & Input4 & Input5 & Input6^ ERROR

Error: Missing separator character after keyword.

Link to comment
Share on other sites

the error says this

:) - What a stragne error, it is not a keyword.

RunWait(@ComSpec & " /c " & @scriptdir & "\external\FLVMERGE.exe" & $Input1 & $Input2 & $Input3 & $Input4 & $Input5 & $Input6, "", @SW_HIDE)

 

Spoiler

Using OS: Win 7 Professional, Using AutoIt Ver(s): 3.3.6.1 / 3.3.8.1

AutoIt_Rus_Community.png AutoIt Russian Community

My Work...

Spoiler

AutoIt_Icon_small.pngProjects: ATT - Application Translate Tool {new}| BlockIt - Block files & folders {new}| SIP - Selected Image Preview {new}| SISCABMAN - SciTE Abbreviations Manager {new}| AutoIt Path Switcher | AutoIt Menu for Opera! | YouTube Download Center! | Desktop Icons Restorator | Math Tasks | KeyBoard & Mouse Cleaner | CaptureIt - Capture Images Utility | CheckFileSize Program

AutoIt_Icon_small.pngUDFs: OnAutoItErrorRegister - Handle AutoIt critical errors {new}| AutoIt Syntax Highlight {new}| Opera Library! | Winamp Library | GetFolderToMenu | Custom_InputBox()! | _FileRun UDF | _CheckInput() UDF | _GUIInputSetOnlyNumbers() UDF | _FileGetValidName() UDF | _GUICtrlCreateRadioCBox UDF | _GuiCreateGrid() | _PathSplitByRegExp() | _GUICtrlListView_MoveItems - UDF | GUICtrlSetOnHover_UDF! | _ControlTab UDF! | _MouseSetOnEvent() UDF! | _ProcessListEx - UDF | GUICtrl_SetResizing - UDF! | Mod. for _IniString UDFs | _StringStripChars UDF | _ColorIsDarkShade UDF | _ColorConvertValue UDF | _GUICtrlTab_CoverBackground | CUI_App_UDF | _IncludeScripts UDF | _AutoIt3ExecuteCode | _DragList UDF | Mod. for _ListView_Progress | _ListView_SysLink | _GenerateRandomNumbers | _BlockInputEx | _IsPressedEx | OnAutoItExit Handler | _GUICtrlCreateTFLabel UDF | WinControlSetEvent UDF | Mod. for _DirGetSizeEx UDF
 
AutoIt_Icon_small.pngExamples: 
ScreenSaver Demo - Matrix included | Gui Drag Without pause the script | _WinAttach()! | Turn Off/On Monitor | ComboBox Handler Example | Mod. for "Thinking Box" | Cool "About" Box | TasksBar Imitation Demo

Like the Projects/UDFs/Examples? Please rate the topic (up-right corner of the post header: Rating AutoIt_Rating.gif)

* === My topics === *

==================================================
My_Userbar.gif
==================================================

 

 

 

AutoIt is simple, subtle, elegant. © AutoIt Team

Link to comment
Share on other sites

The error is now gone thanks to MsCreatoR.

The only problem is how to get the Case $Merge button to work

#include <GUIConstants.au3>

#Region ### START Koda GUI section ### Form=Koda Data.kxf\FLV Merger\Koda Data.kxf
$Form1 = GUICreate("FLV Merger", 593, 367, 193, 125)
$CombineGroup = GUICtrlCreateGroup(" FLV files to combine ", 20, 20, 552, 200)
$Input1 = GUICtrlCreateInput("", 40, 40, 440, 21)
$Input2 = GUICtrlCreateInput("", 40, 70, 440, 21)
$Input3 = GUICtrlCreateInput("", 40, 100, 440, 21)
$Input4 = GUICtrlCreateInput("", 40, 130, 440, 21)
$Input5 = GUICtrlCreateInput("", 40, 160, 440, 21)
$Input6 = GUICtrlCreateInput("", 40, 190, 440, 21)
$Browse1 = GUICtrlCreateButton("Browse...", 485, 40, 67, 21, 0)
$Browse2 = GUICtrlCreateButton("Browse...", 485, 70, 67, 21, 0)
$Browse3 = GUICtrlCreateButton("Browse...", 485, 100, 67, 21, 0)
$Browse4 = GUICtrlCreateButton("Browse...", 485, 130, 67, 21, 0)
$Browse5 = GUICtrlCreateButton("Browse...", 485, 160, 67, 21, 0)
$Browse6 = GUICtrlCreateButton("Browse...", 485, 190, 67, 21, 0)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Options = GUICtrlCreateGroup(" Options ", 20, 230, 225, 100)
$Creator = GUICtrlCreateCheckbox("Add Creator Tag to FLV metadata", 40, 250, 185, 25)
;$CreatorTag = GUICtrlCreateInput("", 40, 300, 185, 21)
$CreatorTag = GUICtrlCreateInput("", 40, 300, 185, 21, $ES_READONLY, $WS_EX_STATICEDGE)
$Label1 = GUICtrlCreateLabel("File Creator Name", 40, 280, 88, 17)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Merge = GUICtrlCreateButton("Merge FLV Files", 265, 290, 285, 40, 0)
GUICtrlSetFont(-1, 12, 400, 0, "Comic Sans MS")
$Save = GUICtrlCreateInput("", 265, 248, 215, 21)
$SaveBrowse = GUICtrlCreateButton("Browse...", 485, 248, 65, 21, 0)
$Label2 = GUICtrlCreateLabel("Save Location", 265, 230, 73, 17)
$FileMenu = GUICtrlCreateMenu("&File")
$Combine = GUICtrlCreateMenuItem("Combine FLV Files", $FileMenu)
$Close = GUICtrlCreateMenuItem("&Exit", $FileMenu)
$HelpMenu = GUICtrlCreateMenu("&Help")
$Help = GUICtrlCreateMenuItem("&View Help", $HelpMenu)
$AboutMenu = GUICtrlCreateMenu("&About")
$About = GUICtrlCreateMenuItem("About This &Program", $AboutMenu)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
Switch GUIGetMsg()
   Case $GUI_EVENT_CLOSE
      Exit
   ;File Menu
   Case $Combine
   Case $Close
      Exit
   ;Help Menu
   Case $Help
      Msgbox(64, "Help", "Help - How to use" & @LF & @LF & @LF & "1. Select the FLV files you would like to combine into one single FLV file." & @LF & @LF & "2. Optionaly, you can select if you want to add the name of the creator." & @LF & @LF & "3. Select the location you would like to save the FLV file." & @LF & @LF & "4. Press the 'Merge FLV Files' button." & @LF & @LF & "5. Go to the location where you saved your FLV file and enjoy watching it!")
   ;About Menu
   Case $About
      Msgbox(0, "About", "This program was designed to combine FLV files into one single file. It uses programs made and designed by 'ASM' and 'Ingo Oppermann'. All work is credited to them. This GUI was desgined by DUNDUA. Please note that I nor 'ASM' and 'Ingo Oppermann' are responsible if it causes any damage to your system or if it doesn't work.")
   ;File Inputs
   Case $Browse1
      $path1 = FileOpenDialog("Select a FLV file to combine", "::{450D8FBA-AD25-11D0-98A8-0800361B1103}", "FLV Files (*.flv)", 1 + 2 )
      If @error Then
         MsgBox(16,"Error","No File chosen")
      Else
         $path1 = StringReplace($path1, "|", @CRLF)
         MsgBox(64,"File Choosen","You have selected: " & $path1)
         GUICtrlSetData ($Input1, $path1 )
      EndIf
   Case $Browse2
      $path2 = FileOpenDialog("Select a FLV file to combine", "::{450D8FBA-AD25-11D0-98A8-0800361B1103}", "FLV Files (*.flv)", 1 + 2 )
      If @error Then
         MsgBox(16,"Error","No File chosen")
      Else
         $path2 = StringReplace($path2, "|", @CRLF)
         MsgBox(64,"File Choosen","You have selected: " & $path2)
         GUICtrlSetData ($Input2, $path2 )
      EndIf
   Case $Browse3
      $path3 = FileOpenDialog("Select a FLV file to combine", "::{450D8FBA-AD25-11D0-98A8-0800361B1103}", "FLV Files (*.flv)", 1 + 2 )
      If @error Then
         MsgBox(16,"Error","No File chosen")
      Else
         $path3 = StringReplace($path3, "|", @CRLF)
         MsgBox(64,"File Choosen","You have selected: " & $path3)
         GUICtrlSetData ($Input3, $path3 )
      EndIf
   Case $Browse4
      $path4 = FileOpenDialog("Select a FLV file to combine", "::{450D8FBA-AD25-11D0-98A8-0800361B1103}", "FLV Files (*.flv)", 1 + 2 )
      If @error Then
         MsgBox(16,"Error","No File chosen")
      Else
         $path4 = StringReplace($path4, "|", @CRLF)
         MsgBox(64,"File Choosen","You have selected: " & $path4)
         GUICtrlSetData ($Input4, $path4 )
      EndIf
   Case $Browse5
      $path5 = FileOpenDialog("Select a FLV file to combine", "::{450D8FBA-AD25-11D0-98A8-0800361B1103}", "FLV Files (*.flv)", 1 + 2 )
      If @error Then
         MsgBox(16,"Error","No File chosen")
      Else
         $path5 = StringReplace($path5, "|", @CRLF)
         MsgBox(64,"File Choosen","You have selected: " & $path5)
         GUICtrlSetData ($Input5, $path5 )
      EndIf
   Case $Browse6
      $path6 = FileOpenDialog("Select a FLV file to combine", "::{450D8FBA-AD25-11D0-98A8-0800361B1103}", "FLV Files (*.flv)", 1 + 2 )
      If @error Then
         MsgBox(16,"Error","No File chosen")
      Else
         $path6 = StringReplace($path6, "|", @CRLF)
         MsgBox(64,"File Choosen","You have selected: " & $path6)
         GUICtrlSetData ($Input6, $path6 )
      EndIf
   ;Options
   Case $Creator
      If GUICtrlRead($Creator) = $GUI_CHECKED Then
         GUICtrlSendMsg($CreatorTag, $EM_SETREADONLY, False, 0)
      Else
         GUICtrlSendMsg($CreatorTag, $EM_SETREADONLY, True, 0)
      EndIf
   ;Save Location
   Case $SaveBrowse
      $savelocation = FileSaveDialog ("Select the location to save combined FLV", "::{450D8FBA-AD25-11D0-98A8-0800361B1103}", "FLV Files (*.flv)", 2)
      If @error Then
         MsgBox(16,"Error","No File Save Location")
      Else
         $savelocation = StringReplace($savelocation, "|", @CRLF)
         MsgBox(64,"File Save Location","You want to save here: " & $savelocation & ".flv")
         GUICtrlSetData ($Save, $savelocation & ".flv" )
      EndIf
;
;This section needs to be fixed
   Case $Merge
      If $Creator = 1 Then
         $tag = "-c " & $CreatorTag
      Else
         $tag = ""
      EndIf
      RunWait(@ComSpec & " /c " & @scriptdir & "\external\FLVMERGE.exe" & $Input1 & $Input2 & $Input3 & $Input4 & $Input5 & $Input6, "", @SW_HIDE)
      FileMove ( @UserProfileDir & "merge.flv", @scriptdir)
      RunWait(@ComSpec & " /c " & @scriptdir & "\external\yamdi\yamdi.exe -i " & @scriptdir & "\merge.flv -o " & $save & $tag, "", @SW_HIDE)
EndSwitch
WEnd
Link to comment
Share on other sites

The only problem is how to get the Case $Merge button to work

It work for me (the button notification).... but it seems that you need to open your help file, and check what is returns each function that used in your script and how to use the returned values :)...

You are using $Input... but if i understand correct, you need the data from input, not the identifier of the control.

Try this version:

#include <GUIConstants.au3>
Opt("RunErrorsFatal", 0)


#Region ### START Koda GUI section ### Form=Koda Data.kxf\FLV Merger\Koda Data.kxf
$Form1 = GUICreate("FLV Merger", 593, 367, 193, 125)
$CombineGroup = GUICtrlCreateGroup(" FLV files to combine ", 20, 20, 552, 200)
$Input1 = GUICtrlCreateInput("", 40, 40, 440, 21)
$Input2 = GUICtrlCreateInput("", 40, 70, 440, 21)
$Input3 = GUICtrlCreateInput("", 40, 100, 440, 21)
$Input4 = GUICtrlCreateInput("", 40, 130, 440, 21)
$Input5 = GUICtrlCreateInput("", 40, 160, 440, 21)
$Input6 = GUICtrlCreateInput("", 40, 190, 440, 21)
$Browse1 = GUICtrlCreateButton("Browse...", 485, 40, 67, 21, 0)
$Browse2 = GUICtrlCreateButton("Browse...", 485, 70, 67, 21, 0)
$Browse3 = GUICtrlCreateButton("Browse...", 485, 100, 67, 21, 0)
$Browse4 = GUICtrlCreateButton("Browse...", 485, 130, 67, 21, 0)
$Browse5 = GUICtrlCreateButton("Browse...", 485, 160, 67, 21, 0)
$Browse6 = GUICtrlCreateButton("Browse...", 485, 190, 67, 21, 0)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Options = GUICtrlCreateGroup(" Options ", 20, 230, 225, 100)
$Creator = GUICtrlCreateCheckbox("Add Creator Tag to FLV metadata", 40, 250, 185, 25)
;$CreatorTag = GUICtrlCreateInput("", 40, 300, 185, 21)
$CreatorTag = GUICtrlCreateInput("", 40, 300, 185, 21, $ES_READONLY, $WS_EX_STATICEDGE)
$Label1 = GUICtrlCreateLabel("File Creator Name", 40, 280, 88, 17)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Merge = GUICtrlCreateButton("Merge FLV Files", 265, 290, 285, 40, 0)
GUICtrlSetFont(-1, 12, 400, 0, "Comic Sans MS")
$Save = GUICtrlCreateInput("", 265, 248, 215, 21)
$SaveBrowse = GUICtrlCreateButton("Browse...", 485, 248, 65, 21, 0)
$Label2 = GUICtrlCreateLabel("Save Location", 265, 230, 73, 17)
$FileMenu = GUICtrlCreateMenu("&File")
$Combine = GUICtrlCreateMenuItem("Combine FLV Files", $FileMenu)
$Close = GUICtrlCreateMenuItem("&Exit", $FileMenu)
$HelpMenu = GUICtrlCreateMenu("&Help")
$Help = GUICtrlCreateMenuItem("&View Help", $HelpMenu)
$AboutMenu = GUICtrlCreateMenu("&About")
$About = GUICtrlCreateMenuItem("About This &Program", $AboutMenu)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
;

While 1
    Switch GUIGetMsg()
        Case $GUI_EVENT_CLOSE, $Close
            Exit
            ;File Menu
        Case $Combine
            
        Case $Help ;Help Menu
            MsgBox(64, "Help", "Help - How to use" & @LF & @LF & @LF & "1. Select the FLV files you would like to combine into one single FLV file." & @LF & @LF & "2. Optionaly, you can select if you want to add the name of the creator." & @LF & @LF & "3. Select the location you would like to save the FLV file." & @LF & @LF & "4. Press the 'Merge FLV Files' button." & @LF & @LF & "5. Go to the location where you saved your FLV file and enjoy watching it!")
        Case $About ;About Menu
            MsgBox(0, "About", "This program was designed to combine FLV files into one single file. It uses programs made and designed by 'ASM' and 'Ingo Oppermann'. All work is credited to them. This GUI was desgined by DUNDUA. Please note that I nor 'ASM' and 'Ingo Oppermann' are responsible if it causes any damage to your system or if it doesn't work.")
            
        Case $Browse1 ;File Inputs
            $path1 = FileOpenDialog("Select a FLV file to combine", "::{450D8FBA-AD25-11D0-98A8-0800361B1103}", "FLV Files (*.flv)", 1 + 2)
            If @error Then
                MsgBox(16, "Error", "No File chosen")
            Else
                $path1 = StringReplace($path1, "|", @CRLF)
                MsgBox(64, "File Choosen", "You have selected: " & $path1)
                GUICtrlSetData($Input1, $path1)
            EndIf
        Case $Browse2
            $path2 = FileOpenDialog("Select a FLV file to combine", "::{450D8FBA-AD25-11D0-98A8-0800361B1103}", "FLV Files (*.flv)", 1 + 2)
            If @error Then
                MsgBox(16, "Error", "No File chosen")
            Else
                $path2 = StringReplace($path2, "|", @CRLF)
                MsgBox(64, "File Choosen", "You have selected: " & $path2)
                GUICtrlSetData($Input2, $path2)
            EndIf
        Case $Browse3
            $path3 = FileOpenDialog("Select a FLV file to combine", "::{450D8FBA-AD25-11D0-98A8-0800361B1103}", "FLV Files (*.flv)", 1 + 2)
            If @error Then
                MsgBox(16, "Error", "No File chosen")
            Else
                $path3 = StringReplace($path3, "|", @CRLF)
                MsgBox(64, "File Choosen", "You have selected: " & $path3)
                GUICtrlSetData($Input3, $path3)
            EndIf
        Case $Browse4
            $path4 = FileOpenDialog("Select a FLV file to combine", "::{450D8FBA-AD25-11D0-98A8-0800361B1103}", "FLV Files (*.flv)", 1 + 2)
            If @error Then
                MsgBox(16, "Error", "No File chosen")
            Else
                $path4 = StringReplace($path4, "|", @CRLF)
                MsgBox(64, "File Choosen", "You have selected: " & $path4)
                GUICtrlSetData($Input4, $path4)
            EndIf
        Case $Browse5
            $path5 = FileOpenDialog("Select a FLV file to combine", "::{450D8FBA-AD25-11D0-98A8-0800361B1103}", "FLV Files (*.flv)", 1 + 2)
            If @error Then
                MsgBox(16, "Error", "No File chosen")
            Else
                $path5 = StringReplace($path5, "|", @CRLF)
                MsgBox(64, "File Choosen", "You have selected: " & $path5)
                GUICtrlSetData($Input5, $path5)
            EndIf
        Case $Browse6
            $path6 = FileOpenDialog("Select a FLV file to combine", "::{450D8FBA-AD25-11D0-98A8-0800361B1103}", "FLV Files (*.flv)", 1 + 2)
            If @error Then
                MsgBox(16, "Error", "No File chosen")
            Else
                $path6 = StringReplace($path6, "|", @CRLF)
                MsgBox(64, "File Choosen", "You have selected: " & $path6)
                GUICtrlSetData($Input6, $path6)
            EndIf
            
        Case $Creator ;Options
            If GUICtrlRead($Creator) = $GUI_CHECKED Then
                GUICtrlSendMsg($CreatorTag, $EM_SETREADONLY, False, 0)
            Else
                GUICtrlSendMsg($CreatorTag, $EM_SETREADONLY, True, 0)
            EndIf
            ;Save Location
        Case $SaveBrowse
            $savelocation = FileSaveDialog("Select the location to save combined FLV", "::{450D8FBA-AD25-11D0-98A8-0800361B1103}", "FLV Files (*.flv)", 2)
            If @error Then
                MsgBox(16, "Error", "No File Save Location")
            Else
                $savelocation = StringReplace($savelocation, "|", @CRLF)
                MsgBox(64, "File Save Location", "You want to save here: " & $savelocation & ".flv")
                GUICtrlSetData($Save, $savelocation & ".flv")
            EndIf
            ;
            
        Case $Merge ;This section needs to be fixed (fixed? :) )
            $tag = ""
            If GUICtrlRead($Creator) = 1 Then $tag = " -c " & GUICtrlRead($CreatorTag)
            
            $Data1 = GUICtrlRead($Input1)
            $Data2 = GUICtrlRead($Input2)
            $Data3 = GUICtrlRead($Input3)
            $Data4 = GUICtrlRead($Input4)
            $Data5 = GUICtrlRead($Input5)
            $Data6 = GUICtrlRead($Input6)
            
            $Merged_Files_Data = StringStripWS($Data1 & " " & $Data2 & " " & $Data3 & " " & $Data4 & " " & $Data5 & " " & $Data6, 7)
            
            RunWait('"' & @ScriptDir & '\external\FLVMERGE.exe" ' & $Merged_Files_Data, '', @SW_HIDE)
            If @error Then
                MsgBox(16, "Error", "There was an error to execute external application <FLVMERGE.exe>")
                ContinueLoop
            EndIf
            
            $FileMove = FileMove(@UserProfileDir & "\merge.flv", @ScriptDir)
            If Not $FileMove Then
                MsgBox(16, "Error", "There was an error to move file <merge.flv>")
                ContinueLoop
            EndIf
            
            RunWait('"' & @ScriptDir & '\external\yamdi\yamdi.exe" -i "' & @ScriptDir & '\merge.flv" -o ' & _
                GUICtrlRead($Save) & $tag, '', @SW_HIDE)
            
            If @error Then MsgBox(16, "Error", "There was an error to execute external application <yamdi.exe>")
    EndSwitch
WEnd

 

Spoiler

Using OS: Win 7 Professional, Using AutoIt Ver(s): 3.3.6.1 / 3.3.8.1

AutoIt_Rus_Community.png AutoIt Russian Community

My Work...

Spoiler

AutoIt_Icon_small.pngProjects: ATT - Application Translate Tool {new}| BlockIt - Block files & folders {new}| SIP - Selected Image Preview {new}| SISCABMAN - SciTE Abbreviations Manager {new}| AutoIt Path Switcher | AutoIt Menu for Opera! | YouTube Download Center! | Desktop Icons Restorator | Math Tasks | KeyBoard & Mouse Cleaner | CaptureIt - Capture Images Utility | CheckFileSize Program

AutoIt_Icon_small.pngUDFs: OnAutoItErrorRegister - Handle AutoIt critical errors {new}| AutoIt Syntax Highlight {new}| Opera Library! | Winamp Library | GetFolderToMenu | Custom_InputBox()! | _FileRun UDF | _CheckInput() UDF | _GUIInputSetOnlyNumbers() UDF | _FileGetValidName() UDF | _GUICtrlCreateRadioCBox UDF | _GuiCreateGrid() | _PathSplitByRegExp() | _GUICtrlListView_MoveItems - UDF | GUICtrlSetOnHover_UDF! | _ControlTab UDF! | _MouseSetOnEvent() UDF! | _ProcessListEx - UDF | GUICtrl_SetResizing - UDF! | Mod. for _IniString UDFs | _StringStripChars UDF | _ColorIsDarkShade UDF | _ColorConvertValue UDF | _GUICtrlTab_CoverBackground | CUI_App_UDF | _IncludeScripts UDF | _AutoIt3ExecuteCode | _DragList UDF | Mod. for _ListView_Progress | _ListView_SysLink | _GenerateRandomNumbers | _BlockInputEx | _IsPressedEx | OnAutoItExit Handler | _GUICtrlCreateTFLabel UDF | WinControlSetEvent UDF | Mod. for _DirGetSizeEx UDF
 
AutoIt_Icon_small.pngExamples: 
ScreenSaver Demo - Matrix included | Gui Drag Without pause the script | _WinAttach()! | Turn Off/On Monitor | ComboBox Handler Example | Mod. for "Thinking Box" | Cool "About" Box | TasksBar Imitation Demo

Like the Projects/UDFs/Examples? Please rate the topic (up-right corner of the post header: Rating AutoIt_Rating.gif)

* === My topics === *

==================================================
My_Userbar.gif
==================================================

 

 

 

AutoIt is simple, subtle, elegant. © AutoIt Team

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...