Jump to content

Create AutoIt script from batch file help


SWB
 Share

Recommended Posts

Explain more.

I've been running this batch program from autoit, which runs fine but, want to run completely from autoit.

Do you want to create a full AutoIt Script by running a bat file.

"How do I pass this to my program, so when my program opens I get this result after it runs"

Do you want to create a console app where you will send switches to it.

Edited by Guest
Link to comment
Share on other sites

I was also confused by the wording.

Perhaps this can help get you started?

#include <GUIConstantsEx.au3>

Opt('MustDeclareVars', 1)

Global $Program = 'C:Program FilesDVDFab 8 Qt'
Dim $msg, $fsf
Dim $guiHandle = GUICreate("Run DVDFAB", 200, 150)
GUICtrlCreateLabel('Destination:' , 5, 5, 190)
Dim $Dest = GUICtrlCreateInput("", 5, 20, 165)
Dim $Folder = GUICtrlCreateButton( '...', 170, 19, 25, 22)
GUICtrlCreateLabel('Year:' , 5, 45, 190)
Dim $Year = GUICtrlCreateInput("", 5, 60, 190)
GUICtrlCreateLabel('Name:' , 5, 85, 190)
Dim $Name = GUICtrlCreateInput("", 5, 100, 190)
Dim $dvdfabbutton  = GUICtrlCreateButton("Run DVDFab", 5, 125, 75)
Dim $exitbutton = GUICtrlCreateButton("Exit", 120, 125, 75)

GUISetState(@SW_SHOW, $guiHandle )
While 1
    $msg = GUIGetMsg($guiHandle )

    Select
        Case $msg == $GUI_EVENT_CLOSE Or $msg = $exitbutton
            Exit
        Case $msg == $Folder
            $fsf = FileSelectFolder('Choose destination folder','')
            If Not @error Then GUICtrlSetData($Dest, $fsf)
        Case $msg == $dvdfabbutton
            RunWait(@ComSpec & " /c " & $Program & 'dvdfab.exe /mode "mainmovie" /src "g:" /dest "' & GUICtrlRead($Dest) & '' & GUICtrlRead($Name) & ' (' & GUICtrlRead($Year) & ')' & GUICtrlRead($Name) & ' (' & GUICtrlRead($Year) & ').iso" /DISPLAYFORCEDSUB "Yes" /Title "auto" /removemenu "yes" /removepgc "yes" /outdisc "dvd9" /close')
            MsgBox(0,'Done',$Program & 'dvdfab.exe /mode "mainmovie" /src "g:" /dest "' & GUICtrlRead($Dest) & '' & GUICtrlRead($Name) & ' (' & GUICtrlRead($Year) & ')' & GUICtrlRead($Name) & ' (' & GUICtrlRead($Year) & ').iso" /DISPLAYFORCEDSUB "Yes" /Title "auto" /removemenu "yes" /removepgc "yes" /outdisc "dvd9" /close')
        Case Default
    EndSelect
WEnd
Link to comment
Share on other sites

I get this as output

%DEST%%SHOW% (%YEAR%)%SHOW% (%YEAR%).ISO

From this:

#cs ----------------------------------------------------------------------------

AutoIt Version: 3.3.8.1

Author:

Script Function:

Template AutoIt script.

#ce ----------------------------------------------------------------------------

;Script Start - Add your code below here

$answer = InputBox("Question", "What Is The Film Destination?","C:Movies", "")

$filmyear = InputBox("Film Year", "Please Enter The Film Year")

$filmname = InputBox("Film Name", "Please Enter The Film Name")

#include <GUIConstantsEx.au3>

Opt('MustDeclareVars', 1)

Dim $msg

Dim $guiHandle = GUICreate("Run DVDFAB", 200, 60)

Dim $blurbLabel = GUICtrlCreateLabel("Enter Your Choice", 5, 5)

Dim $dvdfabbutton = GUICtrlCreateButton("Run DVDFab", 5, 30, 75)

Dim $exitbutton = GUICtrlCreateButton("Exit", 120, 30, 75)

GUISetState(@SW_SHOW, $guiHandle )

While 1

$msg = GUIGetMsg($guiHandle )

Select

Case $msg == $GUI_EVENT_CLOSE Or $msg = $exitbutton

Exit

Case $msg == $dvdfabbutton

;do dvdfab

;********************************************************************

;RunWait(@COMSPEC & " /c Start fabisog.exe") ; THIS WORKS

;********************************************************************

;ShellExecuteWait("fabisog.exe") ; THIS WORKS

;********************************************************************

RunWait('"C:Program FilesDVDFab 8 QtDVDFab.exe" /mode "mainmovie" /src "g:" /dest "%dest%%show% (%year%)%show% (%year%).iso" /DISPLAYFORCEDSUB "Yes" /Title "auto" /removemenu "yes" /removepgc "yes" /outdisc "dvd5" /close"') ; THIS WORKS

MsgBox(0,"Debug","Program is done!")

;RunWait("fabisog.exe") ; THIS WORKS

;MsgBox(0,"Debug","Program is done!")

;********************************************************************

;RunWait(@COMSPEC & " /c Start fabisog.exe") ; THIS WORKS

;********************************************************************

;RunWait("fabisog.exe") ; THIS WORKS

;MsgBox(0,"Debug","Program is done!")

;********************************************************************

Case Default

EndSelect

WEnd

I want to end up wih this

D:MOVIESMURDER BY DEATH (1980)MURDER_BY_DEATH.ISO

Thanks,

Link to comment
Share on other sites

I was also confused by the wording.

Perhaps this can help get you started?

#include <GUIConstantsEx.au3>

Opt('MustDeclareVars', 1)

Global $Program = 'C:Program FilesDVDFab 8 Qt'
Dim $msg, $fsf
Dim $guiHandle = GUICreate("Run DVDFAB", 200, 150)
GUICtrlCreateLabel('Destination:' , 5, 5, 190)
Dim $Dest = GUICtrlCreateInput("", 5, 20, 165)
Dim $Folder = GUICtrlCreateButton( '...', 170, 19, 25, 22)
GUICtrlCreateLabel('Year:' , 5, 45, 190)
Dim $Year = GUICtrlCreateInput("", 5, 60, 190)
GUICtrlCreateLabel('Name:' , 5, 85, 190)
Dim $Name = GUICtrlCreateInput("", 5, 100, 190)
Dim $dvdfabbutton  = GUICtrlCreateButton("Run DVDFab", 5, 125, 75)
Dim $exitbutton = GUICtrlCreateButton("Exit", 120, 125, 75)

GUISetState(@SW_SHOW, $guiHandle )
While 1
    $msg = GUIGetMsg($guiHandle )

    Select
        Case $msg == $GUI_EVENT_CLOSE Or $msg = $exitbutton
            Exit
        Case $msg == $Folder
            $fsf = FileSelectFolder('Choose destination folder','')
            If Not @error Then GUICtrlSetData($Dest, $fsf)
        Case $msg == $dvdfabbutton
            RunWait(@ComSpec & " /c " & $Program & 'dvdfab.exe /mode "mainmovie" /src "g:" /dest "' & GUICtrlRead($Dest) & '' & GUICtrlRead($Name) & ' (' & GUICtrlRead($Year) & ')' & GUICtrlRead($Name) & ' (' & GUICtrlRead($Year) & ').iso" /DISPLAYFORCEDSUB "Yes" /Title "auto" /removemenu "yes" /removepgc "yes" /outdisc "dvd9" /close')
            MsgBox(0,'Done',$Program & 'dvdfab.exe /mode "mainmovie" /src "g:" /dest "' & GUICtrlRead($Dest) & '' & GUICtrlRead($Name) & ' (' & GUICtrlRead($Year) & ')' & GUICtrlRead($Name) & ' (' & GUICtrlRead($Year) & ').iso" /DISPLAYFORCEDSUB "Yes" /Title "auto" /removemenu "yes" /removepgc "yes" /outdisc "dvd9" /close')
        Case Default
    EndSelect
WEnd

I Thank You, This what I was looking for, short and sweet, I guess I took the long way around. What I was doing was trying to read from the inputbox, which doesn't look like you can do,

Thanks Again,

Regards'

SWB

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...