Jump to content

vishu

Active Members
  • Posts

    26
  • Joined

  • Last visited

vishu's Achievements

Seeker

Seeker (1/7)

0

Reputation

  1. Hi Varian, Thanks for the reply.Actually we wanted the functionality to be as stated below. Actually we want the excel sheet to be highlighted based on the option selected from the drop down list and without clicking the "SetValue" button. For Ex: I select 114 in drop down and this should highlight the 114 worksheet without clicking the setvalue button and if i make a second choice thinking I wanted to select 118 then accordingly it should highlight the 118 worksheet even without clicking the setvalue button. Thanks
  2. Hi Varian, Thanks for the reply actually we have the Excel sheet with each and every tab with the below stated IP's: 118 114 & 239 In the application for example if I select 118 it will highlight the 118 tab.Then I think instead of 118 I need to select 114 this is where the problem is when 114 is selected in the application it is not highlghting the corresponding worksheet in excel. Am attaching the Main file pl use this one for your reference. ================================================= Main======================================================================== Pl replace the main file what you have with this file. #include <Excel.au3> ;library for doing excel operations #include <GUIConstantsEx.au3> #include <Misc.au3> #include <Array.au3> #include <file.au3> #include <TS_Automator_Variables.au3> #include-Once Opt("GUICoordMode", 1) ;Checking to see if the AllStreamDetails.xls is already opened If WinExists("Microsoft Excel - AllStreamDetails.xls") Then MsgBox(0, "", "The Excel file is already open") Else ;Reading the files from Desktop ;This file should already exist on the desktop $sFilePath = @DesktopDir & "\AllStreamDetails.xls" ;Opening the Excel file $oExcel = _ExcelBookOpen($sFilePath) EndIf ;Error handling in case the excel file is not existing If @error = 1 Then MsgBox(0, "Error!", "Unable to Create the Excel Object") Exit ElseIf @error = 2 Then MsgBox(0, "Error!", "File does not exist - Please copy the AllStreamDetails.xls onto your desktop and try") Exit EndIf ;Calling the GUI create function createGUI() ;About() Func createGUI() $hGUI = GUICreate("TS-Automator",380,220) GUICtrlCreateLabel("Enter the Modulator IP:",10,30,250,75) ;Combo box with default value as 172.24.18.114 $modulator = GUICtrlCreateCombo("172.24.18.114", 270, 20, 105, 40) ;Combo box with the range of Modulators GUICtrlSetData(-1, "172.24.18.118|172.24.18.239","") GUICtrlCreateLabel("Enter the Module:",10,55,250,75) ;Combo box with default value as EMM $module = GUICtrlCreateCombo("[EMM]", 270, 45, 105, 40) ;Combo box with the range of Modules GUICtrlSetData(-1, "[EWS]|[special Service]|[Parental Rating]|[Region ID]|[Version Change]|[LOGO]|[Frequency List]|[OAD]|[superimpose]|[Caption]|[EPG]|[Partial Stream]|[Audio Toggling]|[Others]","") GUICtrlCreateLabel("Enter the Row Number of the stream to be loaded :",10,80,250,75) $readedit = GUICtrlCreateInput(" ",270,75,75,20) GUICtrlCreateLabel("Select the Frequency to be set from the list:",10,110,250,50) ;Combo box with default value as 473.000 $hCombo = GUICtrlCreateCombo("473.000", 270, 100, 75, 20) ;Combo box with range of frequencies GUICtrlSetData(-1, "479.000|485.000|491.000|497.000|503.000|509.000|515.000|521.000|527.000|533.000|539.000|545.000|551.000|557.000|563.000|569.000|575.000|581.000|587.000|593.000|599.000|605.000|611.000|617.000|623.000|629.000|635.000|641.000|647.000|653.000|659.000|665.000|671.000|677.000|683.000|689.000|695.000|701.000|707.000|713.000|719.000|725.000|731.000|743.000|749.000|755.000|761.000|767.000", "") ; add other item snd set a new default $Automateappbuttn = GUICtrlCreateButton("Automate",220,150,70) $setvaluebuttn = GUICtrlCreateButton("Set Value",30,150,70,25) $exitappbuttn = GUICtrlCreateButton("Exit",120,150,70) $helpmenu = GUICtrlCreateMenu("About") ;creating the info sub menu $infoitem = GUICtrlCreateMenuItem("Info", $helpmenu) ;Making the GUI visible to the end user GUISetState() ;sleep(2000) ;~ While($msg <> $setvaluebuttn) readmodule() ;sleep(3000) Search() ;~ WEnd EndFunc Func About() GUICreate("About",320,145) Local $Msgfonts $Msgfonts = "Comic Sans MS" GUISetFont(8, 500, 0, $Msgfonts) GUICtrlCreateLabel("** Developed by Vishwas K S and Chandana Prakash of CSG-SQE** ", 5, 30) GUICtrlCreateLabel("** LG Soft India Pvt Ltd ** ", 5, 50) GUICtrlCreateLabel("** Version : 0.0a ** ", 5, 70) GUISetFont(7, 400, 0, $Msgfonts) $OKappbutton = GUICtrlCreateButton("OK", 120, 100, 80) GUISetState() EndFunc Func Exitabout() ;deleting the launched About UI GUIDelete(); ;GUISetState(@SW_HIDE) EndFunc ;~ Initiate() ;This function validates the user entry of the Excel row number based on positive value calls the setvalue function Func validate() $redvalue = GUICtrlRead($readedit);Reads the row number entered by the user. If(Int($redvalue)) Then Initiate() Else MsgBox(16, "Error", "Please enter numeric values only") GUICtrlSetData($readedit,"") EndIf EndFunc Func Initiate() msgbox(0,"","entering Initaite") $char = GUICtrlRead($readedit);Read the row number $modip = GUICtrlRead($modulator);Read the modulator chosen by the user Select Case $modip = "172.24.18.114" ;Checking for Invalid rows If ($char=1 Or $char=2 Or $char=6 Or $char=11 Or $char=15 Or $char=25 Or $char=30 Or $char=34 Or $char=47 Or $char=63 Or $char=76 Or $char=79 Or $char=114 Or $char=164 Or $char=168 Or $char=182 Or $char>189) Then Else ;Proceed if valid row number is chosen. WinActivate("Microsoft Excel - AllStreamDetails.xls") $characteristics = _ExcelReadCell($oExcel,$char,4) MsgBox(0,"Characteristics",$characteristics);Display the characteristics of the selected stream. setvalue() EndIf Case $modip = "172.24.18.118" ;Checking for Invalid rows If ($char=1 Or $char=2 Or $char=7 Or $char=17 Or $char=21 Or $char=31 Or $char=36 Or $char=40 Or $char=53 Or $char=69 Or $char=87 Or $char=90 Or $char=122 Or $char=175 Or $char=179 Or $char=195 Or $char>203) Then MsgBox(0,"Error","Invalid Row number selected") ControlSetText("[CLASS:AutoIt v3 GUI]","","Edit3","") sleep(3000) readmodule() Else ;Proceed if valid row number is chosen. WinActivate("Microsoft Excel - AllStreamDetails.xls") $characteristics = _ExcelReadCell($oExcel,$char,4) MsgBox(0,"Characteristics",$characteristics);Display the characteristics of the selected stream. setvalue() EndIf Case $modip = "172.24.18.239" ;Checking for Invalid rows If ($char=1 Or $char=2 Or $char=6 Or $char=11 Or $char=15 Or $char=25 Or $char=30 Or $char=34 Or $char=44 Or $char=53 Or $char=56 Or $char=58 Or $char=77 Or $char=101 Or $char=104 Or $char=114 Or $char>118) Then MsgBox(0,"Error","Invalid Row number selected") ControlSetText("[CLASS:AutoIt v3 GUI]","","Edit3","") sleep(3000) readmodule() Else ;Proceed if valid row number is chosen. WinActivate("Microsoft Excel - AllStreamDetails.xls") $characteristics = _ExcelReadCell($oExcel,$char,4) MsgBox(0,"Characteristics",$characteristics);Display the characteristics of the selected stream. setvalue() EndIf EndSelect EndFunc ;This function reads the Modulator chosen by the user. Func readmodule() $modip = GUICtrlRead($modulator); read the Modulator IP chosen by the user. ;Activate the particular sheet in All Stream Details depending on the Modulator IP chosen by the user. Select Case $modip = "172.24.18.114" _ExcelSheetActivate($oExcel, "ISDB-T Stream Details_Mod-114") Case $modip = "172.24.18.118" _ExcelSheetActivate($oExcel, "ISDB-T Stream Details_Mod-118") Case $modip = "172.24.18.239" _ExcelSheetActivate($oExcel, "ISDB-T Stream Details_Mod-239") EndSelect EndFunc ;This function is used to search the location of the module name entered by the user and highlight it. Func Search() Local $i, $concat $mod = GUICtrlRead($module) For $i = 2 To 205 $readmodule = _ExcelReadCell($oExcel,$i,1) If($mod = $readmodule) Then $concat = "A" & $i $oExcel.Activesheet.Range($concat).select ;~ MsgBox(0,"Module read from the Stream details",$readmodule ) EndIf Next EndFunc Func setvalue() Local $currentlistselection ;~ ;If condition which reads the combobox to find the current selection If GUICtrlRead($hCombo) <> $currentlistselection Then ;Reads the new selection value to $hCombo variable $currentlistselection = GUICtrlRead($hCombo) ;MsgBox(0, "", "The Cell Value is: " & @CRLF & $currentlistselection, 2) EndIf ;Activates the already opened Dektec application WinActivate("DekTec StreamXpress - Transport-Stream Player") ;Moves the application to screen co-ordinates to 0,0 WinMove("DekTec StreamXpress - Transport-Stream Player", "", 0, 0) ;Delay needed to ensure the dektec in moved to the left top corner Sleep(500) ;Reading the file -> $oExcel, Reading the row number -> $redvalue,Reading the column -> 2 If IsString($sCellValue)Then $sCellValue = _ExcelReadCell($oExcel, $redvalue, 2) MsgBox(0, "", "The Cell Value is: " & @CRLF & $sCellValue, 2) ElseIf $sCellValue = "" Then MsgBox(0, "", "The Cell number selected is invalid: ") EndIf ;This commented lines reads the current stream being played by the streamer xpress app ;local $getstreamervalue ;$getstreamervalue = ControlGetText("DekTec StreamXpress - Transport-Stream Player", "", "Edit1") ;MsgBox(0, "", "The stream being played is: " & @CRLF & $getstreamervalue, 2) ;This commented lines reads the current frequency selected in the streamer xpress app ;local $getstreamerfreq ;$getstreamerfreq = ControlGetText("Streamer set Frequency is:", "", "Edit2") ;MsgBox(0, "", "The streamer frequency Value is: " & @CRLF & $getstreamerfreq, 2) Local $setstream ;Button1 clicks the "open" button in Dektec app ControlClick("DekTec StreamXpress - Transport-Stream Player", "", "Button1") ;Activating the UI which appears after clicking the "open" button WinActivate("Open MPEG-2 Transport Stream") ;Delay provided to ensure the above window is launched sleep(2000) ;Setting the stream path read from "$sCellValue"(Excel file) onto the Text box(Edit1) before the Open button $setstream = ControlSetText ("Open MPEG-2 Transport Stream", " ", "Edit1", $sCellValue) ;MsgBox(0, "", "The Cell Value is: " & @CRLF & $sCellValue, 2) ;Delay provided to esnure the read stream path is copied onto the textbox(Edit1) sleep(1000) ;Pressing the Open button(Button2) to ensure the selected stream is opened in streamer application ControlClick("Open MPEG-2 Transport Stream", "", "Button2") ;MsgBox(0, "", "The stream being played is: " & @CRLF & $setstream, 2) WinActivate("TS-Automator") local $getappfreq ;Reading the frequency from our application and storing in $getappfreq $getappfreq = ControlGetText("TS-Automator", "", "Edit4") MsgBox(0, "", "The application frequency Value is: " & @CRLF & $getappfreq, 2) ;Copying the read frequency value to the streamer application(Edit6) text box $setappfreq = ControlSetText ( "DekTec StreamXpress - Transport-Stream Player", " ", "Edit6", $getappfreq) ;Ensuring the playback is stopped in streamer application ControlClick("DekTec StreamXpress - Transport-Stream Player", "", "Button21","left",2) sleep(1000) ;Ensuring the play button is pressed to start the current selected stream playback ControlClick("DekTec StreamXpress - Transport-Stream Player", "", "Button19","left",2) EndFunc Func Automate() $hGUI = GUICreate("Automate",450,500) GUICtrlCreateLabel("First Stream Path :",8,20,130,15) GUICtrlCreateLabel("Second Stream Path :",8,60,130,15) GUICtrlCreateLabel("Third Stream Path :",8,100,130,15) GUICtrlCreateLabel("Fourth Stream Path :",8,140,130,15) GUICtrlCreateLabel("Fifth Stream Path :",8,180,130,15) GUICtrlCreateLabel("Sixth Stream Path :",8,220,130,15) GUICtrlCreateLabel("Seventh Stream Path :",8,260,130,15) GUICtrlCreateLabel("Eighth Stream Path :",8,300,130,15) GUICtrlCreateLabel("Nineth Stream Path :",8,340,130,15) GUICtrlCreateLabel("Tenth Stream Path :",8,380,130,15) $readfirstautoedit = GUICtrlCreateInput("", 140,20,200,20) $hCombo1 = GUICtrlCreateCombo("473.000", 360, 20, 75, 20) ;Combo box with range of frequencies GUICtrlSetData(-1, "479.000|485.000|491.000|497.000|503.000|509.000|515.000|521.000|527.000|533.000|539.000|545.000|551.000|557.000|563.000|569.000|575.000|581.000|587.000|593.000|599.000|605.000|611.000|617.000|623.000|629.000|635.000|641.000|647.000|653.000|659.000|665.000|671.000|677.000|683.000|689.000|695.000|701.000|707.000|713.000|719.000|725.000|731.000|743.000|749.000|755.000|761.000|767.000", "") ; add other item snd set a new default $readsecondautoedit = GUICtrlCreateInput("",140,60,200,20) $hCombo2 = GUICtrlCreateCombo("473.000", 360, 60, 75, 20) ;Combo box with range of frequencies GUICtrlSetData(-1, "479.000|485.000|491.000|497.000|503.000|509.000|515.000|521.000|527.000|533.000|539.000|545.000|551.000|557.000|563.000|569.000|575.000|581.000|587.000|593.000|599.000|605.000|611.000|617.000|623.000|629.000|635.000|641.000|647.000|653.000|659.000|665.000|671.000|677.000|683.000|689.000|695.000|701.000|707.000|713.000|719.000|725.000|731.000|743.000|749.000|755.000|761.000|767.000", "") ; add other item snd set a new default $readthirdautoedit = GUICtrlCreateInput("",140,100,200,20) $hCombo3 = GUICtrlCreateCombo("473.000", 360, 100, 75, 20) ;Combo box with range of frequencies GUICtrlSetData(-1, "479.000|485.000|491.000|497.000|503.000|509.000|515.000|521.000|527.000|533.000|539.000|545.000|551.000|557.000|563.000|569.000|575.000|581.000|587.000|593.000|599.000|605.000|611.000|617.000|623.000|629.000|635.000|641.000|647.000|653.000|659.000|665.000|671.000|677.000|683.000|689.000|695.000|701.000|707.000|713.000|719.000|725.000|731.000|743.000|749.000|755.000|761.000|767.000", "") ; add other item snd set a new default $readfourthautoedit = GUICtrlCreateInput("",140,140,200,20) $hCombo4 = GUICtrlCreateCombo("473.000", 360, 140, 75, 20) ;Combo box with range of frequencies GUICtrlSetData(-1, "479.000|485.000|491.000|497.000|503.000|509.000|515.000|521.000|527.000|533.000|539.000|545.000|551.000|557.000|563.000|569.000|575.000|581.000|587.000|593.000|599.000|605.000|611.000|617.000|623.000|629.000|635.000|641.000|647.000|653.000|659.000|665.000|671.000|677.000|683.000|689.000|695.000|701.000|707.000|713.000|719.000|725.000|731.000|743.000|749.000|755.000|761.000|767.000", "") ; add other item snd set a new default $readfifthautoedit = GUICtrlCreateInput("",140,180,200,20) $hCombo5 = GUICtrlCreateCombo("473.000", 360, 180, 75, 20) ;Combo box with range of frequencies GUICtrlSetData(-1, "479.000|485.000|491.000|497.000|503.000|509.000|515.000|521.000|527.000|533.000|539.000|545.000|551.000|557.000|563.000|569.000|575.000|581.000|587.000|593.000|599.000|605.000|611.000|617.000|623.000|629.000|635.000|641.000|647.000|653.000|659.000|665.000|671.000|677.000|683.000|689.000|695.000|701.000|707.000|713.000|719.000|725.000|731.000|743.000|749.000|755.000|761.000|767.000", "") ; add other item snd set a new default $readsixthautoedit = GUICtrlCreateInput("",140,220,200,20) $hCombo6 = GUICtrlCreateCombo("473.000", 360, 220, 75, 20) ;Combo box with range of frequencies GUICtrlSetData(-1, "479.000|485.000|491.000|497.000|503.000|509.000|515.000|521.000|527.000|533.000|539.000|545.000|551.000|557.000|563.000|569.000|575.000|581.000|587.000|593.000|599.000|605.000|611.000|617.000|623.000|629.000|635.000|641.000|647.000|653.000|659.000|665.000|671.000|677.000|683.000|689.000|695.000|701.000|707.000|713.000|719.000|725.000|731.000|743.000|749.000|755.000|761.000|767.000", "") ; add other item snd set a new default $readseventhautoedit = GUICtrlCreateInput("",140,260,200,20) $hCombo7 = GUICtrlCreateCombo("473.000", 360, 260, 75, 20) ;Combo box with range of frequencies GUICtrlSetData(-1, "479.000|485.000|491.000|497.000|503.000|509.000|515.000|521.000|527.000|533.000|539.000|545.000|551.000|557.000|563.000|569.000|575.000|581.000|587.000|593.000|599.000|605.000|611.000|617.000|623.000|629.000|635.000|641.000|647.000|653.000|659.000|665.000|671.000|677.000|683.000|689.000|695.000|701.000|707.000|713.000|719.000|725.000|731.000|743.000|749.000|755.000|761.000|767.000", "") ; add other item snd set a new default $readeighthautoedit = GUICtrlCreateInput("",140,300,200,20) $hCombo8 = GUICtrlCreateCombo("473.000", 360, 300, 75, 20) ;Combo box with range of frequencies GUICtrlSetData(-1, "479.000|485.000|491.000|497.000|503.000|509.000|515.000|521.000|527.000|533.000|539.000|545.000|551.000|557.000|563.000|569.000|575.000|581.000|587.000|593.000|599.000|605.000|611.000|617.000|623.000|629.000|635.000|641.000|647.000|653.000|659.000|665.000|671.000|677.000|683.000|689.000|695.000|701.000|707.000|713.000|719.000|725.000|731.000|743.000|749.000|755.000|761.000|767.000", "") ; add other item snd set a new default $readninethautoedit = GUICtrlCreateInput("",140,340,200,20) $hCombo9 = GUICtrlCreateCombo("473.000", 360, 340, 75, 20) ;Combo box with range of frequencies GUICtrlSetData(-1, "479.000|485.000|491.000|497.000|503.000|509.000|515.000|521.000|527.000|533.000|539.000|545.000|551.000|557.000|563.000|569.000|575.000|581.000|587.000|593.000|599.000|605.000|611.000|617.000|623.000|629.000|635.000|641.000|647.000|653.000|659.000|665.000|671.000|677.000|683.000|689.000|695.000|701.000|707.000|713.000|719.000|725.000|731.000|743.000|749.000|755.000|761.000|767.000", "") ; add other item snd set a new default $readTenthautoedit = GUICtrlCreateInput("",140,380,200,20) $hCombo10 = GUICtrlCreateCombo("473.000", 360, 380, 75, 20) ;Combo box with range of frequencies GUICtrlSetData(-1, "479.000|485.000|491.000|497.000|503.000|509.000|515.000|521.000|527.000|533.000|539.000|545.000|551.000|557.000|563.000|569.000|575.000|581.000|587.000|593.000|599.000|605.000|611.000|617.000|623.000|629.000|635.000|641.000|647.000|653.000|659.000|665.000|671.000|677.000|683.000|689.000|695.000|701.000|707.000|713.000|719.000|725.000|731.000|743.000|749.000|755.000|761.000|767.000", "") ; add other item snd set a new default $Mobility= GUICtrlCreateCheckbox("Mobility", 290, 433, 120, 20) GUICtrlGetState($Mobility) ;Creating the delay button GUICtrlCreateLabel("Delay",60,439,30,25) $delay = GUICtrlCreateInput("", 90,433 ,30,20) ;Loop button checkbox $chkbox = GUICtrlCreateCheckbox("Loop", 170, 433, 120, 20) GUICtrlGetState($chkbox) ;Creating the Start button $Startappbuttn = GUICtrlCreateButton("Start",55,460,70) ;The object refers to the already defined Exit button $exitappbuttn = GUICtrlCreateButton("Exit",165,460,70) GUISetState() EndFunc Func Batch() if WinExists("Automate") Then WinActivate("Automate") $read = GUICtrlRead($chkbox);Check if the user has enabled the loop option $MobilityRead=GUICtrlRead($Mobility) if $read = $GUI_CHECKED Then While(1) $userdelay = GUICtrlRead($delay);Read the delay entered by the user If (Int($userdelay)) Then msgbox(0,"Delay","User defined delay is:"& @CRLF & $userdelay,1) If $MobilityRead = $GUI_CHECKED Then Mobility() Else setstream() Endif Else MsgBox(16, "Error", "Please enter numeric values only") EndIf WEnd Else $userdelay = GUICtrlRead($delay);Read the delay entered by the user If (Int($userdelay)) Then msgbox(0,"Delay","User defined delay is:"& @CRLF & $userdelay,1) If $MobilityRead = $GUI_CHECKED Then Mobility() Else setstream() Endif Else MsgBox(16, "Error", "Please enter numeric values only") EndIf EndIf Endif EndFunc Func getvalues() ;reading the values from the text box for all the paths in Automate screen $firstvalue = GUICtrlRead($readfirstautoedit) $secondvalue = GUICtrlRead($readsecondautoedit) $thirdvalue = GUICtrlRead($readthirdautoedit) $fourthvalue = GUICtrlRead($readfourthautoedit) $fifthvalue = GUICtrlRead($readfifthautoedit) $sixthvalue = GUICtrlRead($readsixthautoedit) $seventhvalue = GUICtrlRead($readseventhautoedit) $eigthvalue = GUICtrlRead($readeighthautoedit) $ninethvalue = GUICtrlRead($readninethautoedit) EndFunc Func setstream() getvalues() Local $Frequency $Frequency = ControlGetText("Automate", "", "Edit2") MsgBox(0,"Frequency",$Frequency,1 ) ;Copying the read frequency value to the streamer application(Edit6) text box Local $setfreq = ControlSetText ( "DekTec StreamXpress - Transport-Stream Player", " ", "Edit6", $Frequency) Local $i for $i = 0 to 9 step 1 Local $path[50] = [$firstvalue, $secondvalue,$thirdvalue,$fourthvalue,$fifthvalue,$sixthvalue,$seventhvalue,$eigthvalue,$ninethvalue,$tenthvalue] ;Activates the already opened Dektec application WinActivate("DekTec StreamXpress - Transport-Stream Player") ;Button1 clicks the "open" button in Dektec app sleep(1000) ControlClick("DekTec StreamXpress - Transport-Stream Player", "", "Button1") ;Activating the UI which appears after clicking the "open" button sleep(1000) WinActivate("Open MPEG-2 Transport Stream") ;Setting the stream path read from the Automate UI onto the Text box(Edit1) before the Open button $copystream = ControlSetText ("Open MPEG-2 Transport Stream", " ", "Edit1", $path[$i]) sleep(1000) ;~ MsgBox(0, "", "The stream being played is: " & @CRLF & $path[$i] , 1) sleep(1000) ControlClick("Open MPEG-2 Transport Stream", "", "Button2") ;Ensuring the playback is stopped in streamer application ControlClick("DekTec StreamXpress - Transport-Stream Player", "", "Button21","left",2) sleep(1000) ;Ensuring the play button is pressed to start the current selected stream playback ControlClick("DekTec StreamXpress - Transport-Stream Player", "", "Button19","left",2) ;These lines read the current stream being played by the streamer xpress app local $getstreamervalue $getstreamervalue = ControlGetText("DekTec StreamXpress - Transport-Stream Player", "", "Edit1") ;~ MsgBox(0, "", "The stream being played is in streamer is: " & @CRLF & $getstreamervalue, 2) sleep($userdelay) Next EndFunc Func Mobility() $firstvalue = GUICtrlRead($readfirstautoedit) ;Activates the already opened Dektec application WinActivate("DekTec StreamXpress - Transport-Stream Player") ;Button1 clicks the "open" button in Dektec app sleep(1000) ControlClick("DekTec StreamXpress - Transport-Stream Player", "", "Button1") ;Activating the UI which appears after clicking the "open" button ;~ sleep(1000) WinActivate("Open MPEG-2 Transport Stream") ;Setting the stream path read from the Automate UI onto the Text box(Edit1) before the Open button $copystream = ControlSetText ("Open MPEG-2 Transport Stream", " ", "Edit1", $firstvalue) sleep(1000) MsgBox(0, "", "The stream being played is: " & @CRLF & $firstvalue , 1) sleep(2000) ControlClick("Open MPEG-2 Transport Stream", "", "Button2") ;These lines read the current stream being played by the streamer xpress app local $getstreamervalue $getstreamervalue = ControlGetText("DekTec StreamXpress - Transport-Stream Player", "", "Edit1") ;~ MsgBox(0, "", "The stream being played is in streamer is: " & @CRLF & $getstreamervalue, 2) for $j=0 To 9 local $getMFNfreq ;Reading the frequency from our application and storing in $getappfreq $getMFNfreq = ControlGetText("Automate", "", $Class[$j]) MsgBox(0,"Frequency",$getMFNfreq,1 ) ;Copying the read frequency value to the streamer application(Edit6) text box Local $setappfreq = ControlSetText ( "DekTec StreamXpress - Transport-Stream Player", " ", "Edit6", $getMFNfreq) ;Ensuring the playback is stopped in streamer application ControlClick("DekTec StreamXpress - Transport-Stream Player", "", "Button21","left",2) sleep(10000) ;Ensuring the play button is pressed to start the current selected stream playback ControlClick("DekTec StreamXpress - Transport-Stream Player", "", "Button19","left",2) sleep($userdelay) Next EndFunc While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE WinActivate("Microsoft Excel - AllStreamDetails.xls") _ExcelBookClose($oExcel,0) Exit Case $msg = $setvaluebuttn validate() Case $msg = $Automateappbuttn Automate() Case $msg = $Startappbuttn Batch() Case $msg = $infoitem About() Case $msg = $OKappbutton Exitabout() Case $msg = $exitappbuttn _ExcelBookClose($oExcel,0) Exit EndSelect WEnd =========================================================================================================================================
  3. file:///C:/Documents%20and%20Settings/vishwas/Desktop/24th%20September%202010/Main%20screen.JPG
  4. Hi, I have a query I have attached a snap shot, But not sure if you are able to see it in the text body. Here I have an IP and Module selection Text Box, the use of it is like I have an excel sheet with different IP's based on whatever IP's I select from the drop down the corresponding sheet will be highlighted same w.r.t the Modules also. The problem which am facing is am able to make the selecvtion only once and the appliaction won't accept the selection if made for the second time.I mean first I will slect 118 IP then 118 sheet is activated , but in the meanwhile I make a choice of selecting 114 and if I select the corresponding excel sheet is not getting activated.Also I have a problem where to accomdate the while loop because the application needs to wait for the user to make his choice but my application is going for a timeout. I have 2 scripts first one stated below is the variables declaration script and the second one is the Main script .Pl suggest. =============================================== Variable file =================================================================== Pl save this file with the following name : "TS_Automator_Variables.au3" ;$sFilePath is the variable which contains the path of All Stream Details. Global $sFilePath ;$readedit is the variable which holds the Control ID of the text box created to enter the row number. Global $readedit ;$currentrangeselection is the variable which stores the frequency value read from the Combo box. Global $currentrangeselection ;$hCombo is the variable which holds the control ID of the Combo Box having a range of frequencies. Global $hCombo ;$chkbox is the variable to read if looping is enabled for Automation. Global $chkbox ;$module is the variable which holds the control ID of the Combo box having a range of Modules Global $module ;$mod is the variable which holds the Module selected. Global $mod ;$modulator is the variable which holds the control ID of the Combo Box having a range of Modulator IPs. Global $modulator ;$modip is the variable which holds the Modulator IP chosen by the user. Global $modip ;$OKappbutton is the variable which holds the COntrol ID of the OK Button created. Global $OKappbutton ;$infoitem is the variable which holds the Control ID for the Info option in Menu. Global $infoitem ;$Mobility is the variable which holds the Control ID of the Radio button created. Global $Mobility ; $MobilityRead is the variable which holds the data whether Mobility is enabled or disabled. Global $MobilityRead ;$copystream is the variable which holds the stream name set in the Dectec. Global $copystream ;$redvalue is the variable which accepts the 3 digit numerals for reading the row numbers from excel file Global $redvalue = String(3) ;$sCellValue is the variable which holds the Stream name read from the All Stream Details. Global $sCellValue ;Excel object Global $oExcel ;$Startappbuttn is the variable which holds the Control ID for the Start button created. Global $Startappbuttn ;$setvaluebuttn is the variable which holds the Control ID for the Setvalue button created. Global $setvaluebuttn ;$Automateappbuttn is the variable which holds the Control ID for the Automate button created. Global $Automateappbuttn ;$msg is the variable which holds the Control ID of an event. Global $msg ;$exitappbuttn is the variable which holds the Control ID for the Exit button created. Global $exitappbuttn ;$delay is the variable which holds the Control ID for the Text box created to enter the delay. Global $delay ;$userdelay is the variable which reads the delay entered by the user. Global $userdelay ;Variables which hold the Control ID for the text box created to enter the streams in the Automate UI. Global $readfirstautoedit,$readsecondautoedit,$readthirdautoedit,$readfourthautoedit,$readfifthautoedit,$readsixthautoedit,$readseventhautoedit,$readeighthautoedit,$readninethautoedit,$readTenthautoedit ;Variables which hold the streams entered by the user in the Text box of the Automate UI. Global $firstvalue,$secondvalue,$thirdvalue,$fourthvalue,$fifthvalue,$fifthvalue,$sixthvalue,$seventhvalue,$eigthvalue,$ninethvalue,$tenthvalue ;Variables which hold the Control IDs of the Combo box having the range of frequencies Global $hCombo1,$hCombo2,$hCombo3,$hCombo4,$hCombo5,$hCombo6,$hCombo7,$hCombo8,$hCombo9,$hCombo10 ;Array consisting of the variables which hols the Mobility related frequencies selected by the user in Automate UI. Global $Class[50] = ["Edit2","Edit4","Edit6","Edit8","Edit10","Edit12","Edit14","Edit16","Edit18","Edit20"] ;$setappfreq is the variable which holds the frequency that is set in the Dektec. Global $setappfreq =================================================================================================================================== =============================================== Main file =================================================================== Pl save this file in the following name : "TS Automator_Final.au3" #include <Excel.au3> ;library for doing excel operations #include <GUIConstantsEx.au3> #include <Misc.au3> #include <Array.au3> #include <file.au3> #include <TS_Automator_Variables.au3> #include-Once Opt("GUICoordMode", 1) ;Checking to see if the AllStreamDetails.xls is already opened If WinExists("Microsoft Excel - AllStreamDetails.xls") Then MsgBox(0, "", "The Excel file is already open") Else ;Reading the files from Desktop ;This file should already exist on the desktop $sFilePath = @DesktopDir & "\AllStreamDetails.xls" ;Opening the Excel file $oExcel = _ExcelBookOpen($sFilePath) EndIf ;Error handling in case the excel file is not existing If @error = 1 Then MsgBox(0, "Error!", "Unable to Create the Excel Object") Exit ElseIf @error = 2 Then MsgBox(0, "Error!", "File does not exist - Please copy the AllStreamDetails.xls onto your desktop and try") Exit EndIf ;Calling the GUI create function createGUI() About() Func createGUI() $hGUI = GUICreate("TS-Automator",380,220) GUICtrlCreateLabel("Enter the Modulator IP:",10,30,250,75) ;Combo box with default value as 172.24.18.114 $modulator = GUICtrlCreateCombo("172.24.18.114", 270, 20, 105, 40) ;Combo box with the range of Modulators GUICtrlSetData(-1, "172.24.18.118|172.24.18.239","") GUICtrlCreateLabel("Enter the Module:",10,55,250,75) ;Combo box with default value as EMM $module = GUICtrlCreateCombo("[EMM]", 270, 45, 105, 40) ;Combo box with the range of Modules GUICtrlSetData(-1, "[EWS]|[special Service]|[Parental Rating]|[Region ID]|[Version Change]|[LOGO]|[Frequency List]|[OAD]|[superimpose]|[Caption]|[EPG]|[Partial Stream]|[Audio Toggling]|[Others]","") GUICtrlCreateLabel("Enter the Row Number of the stream to be loaded :",10,80,250,75) $readedit = GUICtrlCreateInput(" ",270,75,75,20) GUICtrlCreateLabel("Select the Frequency to be set from the list:",10,110,250,50) ;Combo box with default value as 473.000 $hCombo = GUICtrlCreateCombo("473.000", 270, 100, 75, 20) ;Combo box with range of frequencies GUICtrlSetData(-1, "479.000|485.000|491.000|497.000|503.000|509.000|515.000|521.000|527.000|533.000|539.000|545.000|551.000|557.000|563.000|569.000|575.000|581.000|587.000|593.000|599.000|605.000|611.000|617.000|623.000|629.000|635.000|641.000|647.000|653.000|659.000|665.000|671.000|677.000|683.000|689.000|695.000|701.000|707.000|713.000|719.000|725.000|731.000|743.000|749.000|755.000|761.000|767.000", "") ; add other item snd set a new default $Automateappbuttn = GUICtrlCreateButton("Automate",220,150,70) $setvaluebuttn = GUICtrlCreateButton("Set Value",30,150,70,25) $exitappbuttn = GUICtrlCreateButton("Exit",120,150,70) $helpmenu = GUICtrlCreateMenu("About") ;creating the info sub menu $infoitem = GUICtrlCreateMenuItem("Info", $helpmenu) ;Making the GUI visible to the end user GUISetState() ;~ sleep(2000) ;~ While($msg <> $setvaluebuttn) ;~ readmodule() ;~ Search() ;~ WEnd EndFunc Func About() GUICreate("About",320,145) Local $Msgfonts $Msgfonts = "Comic Sans MS" GUISetFont(8, 500, 0, $Msgfonts) GUICtrlCreateLabel("** Developed by Vishwas K S and Chandana Prakash of CSG-SQE** ", 5, 30) GUICtrlCreateLabel("** LG Soft India Pvt Ltd ** ", 5, 50) GUICtrlCreateLabel("** Version : 0.0a ** ", 5, 70) GUISetFont(7, 400, 0, $Msgfonts) $OKappbutton = GUICtrlCreateButton("OK", 120, 100, 80) GUISetState() EndFunc Func Exitabout() ;deleting the launched About UI GUISetState(@SW_HIDE) EndFunc ;~ Initiate() ;This function validates the user entry of the Excel row number based on positive value calls the setvalue function Func validate() $redvalue = GUICtrlRead($readedit);Reads the row number entered by the user. If(Int($redvalue)) Then Initiate() Else MsgBox(16, "Error", "Please enter numeric values only") GUICtrlSetData($readedit,"") EndIf EndFunc Func Initiate() msgbox(0,"","entering Initaite") $char = GUICtrlRead($readedit);Read the row number $modip = GUICtrlRead($modulator);Read the modulator chosen by the user Select Case $modip = "172.24.18.114" ;Checking for Invalid rows If ($char=1 Or $char=2 Or $char=6 Or $char=11 Or $char=15 Or $char=25 Or $char=30 Or $char=34 Or $char=47 Or $char=63 Or $char=76 Or $char=79 Or $char=114 Or $char=164 Or $char=168 Or $char=182 Or $char>189) Then Else ;Proceed if valid row number is chosen. WinActivate("Microsoft Excel - AllStreamDetails.xls") $characteristics = _ExcelReadCell($oExcel,$char,4) MsgBox(0,"Characteristics",$characteristics);Display the characteristics of the selected stream. setvalue() EndIf Case $modip = "172.24.18.118" ;Checking for Invalid rows If ($char=1 Or $char=2 Or $char=7 Or $char=17 Or $char=21 Or $char=31 Or $char=36 Or $char=40 Or $char=53 Or $char=69 Or $char=87 Or $char=90 Or $char=122 Or $char=175 Or $char=179 Or $char=195 Or $char>203) Then MsgBox(0,"Error","Invalid Row number selected") ControlSetText("[CLASS:AutoIt v3 GUI]","","Edit3","") sleep(3000) readmodule() Else ;Proceed if valid row number is chosen. WinActivate("Microsoft Excel - AllStreamDetails.xls") $characteristics = _ExcelReadCell($oExcel,$char,4) MsgBox(0,"Characteristics",$characteristics);Display the characteristics of the selected stream. setvalue() EndIf Case $modip = "172.24.18.239" ;Checking for Invalid rows If ($char=1 Or $char=2 Or $char=6 Or $char=11 Or $char=15 Or $char=25 Or $char=30 Or $char=34 Or $char=44 Or $char=53 Or $char=56 Or $char=58 Or $char=77 Or $char=101 Or $char=104 Or $char=114 Or $char>118) Then MsgBox(0,"Error","Invalid Row number selected") ControlSetText("[CLASS:AutoIt v3 GUI]","","Edit3","") sleep(3000) readmodule() Else ;Proceed if valid row number is chosen. WinActivate("Microsoft Excel - AllStreamDetails.xls") $characteristics = _ExcelReadCell($oExcel,$char,4) MsgBox(0,"Characteristics",$characteristics);Display the characteristics of the selected stream. setvalue() EndIf EndSelect EndFunc ;This function reads the Modulator chosen by the user. Func readmodule() $modip = GUICtrlRead($modulator); read the Modulator IP chosen by the user. ;Activate the particular sheet in All Stream Details depending on the Modulator IP chosen by the user. Select Case $modip = "172.24.18.114" _ExcelSheetActivate($oExcel, "ISDB-T Stream Details_Mod-114") Case $modip = "172.24.18.118" _ExcelSheetActivate($oExcel, "ISDB-T Stream Details_Mod-118") Case $modip = "172.24.18.239" _ExcelSheetActivate($oExcel, "ISDB-T Stream Details_Mod-239") EndSelect EndFunc ;This function is used to search the location of the module name entered by the user and highlight it. Func Search() Local $i, $concat $mod = GUICtrlRead($module) For $i = 2 To 205 $readmodule = _ExcelReadCell($oExcel,$i,1) If($mod = $readmodule) Then $concat = "A" & $i $oExcel.Activesheet.Range($concat).select ;~ MsgBox(0,"Module read from the Stream details",$readmodule ) EndIf Next EndFunc Func setvalue() Local $currentlistselection ;~ ;If condition which reads the combobox to find the current selection If GUICtrlRead($hCombo) <> $currentlistselection Then ;Reads the new selection value to $hCombo variable $currentlistselection = GUICtrlRead($hCombo) ;MsgBox(0, "", "The Cell Value is: " & @CRLF & $currentlistselection, 2) EndIf ;Activates the already opened Dektec application WinActivate("DekTec StreamXpress - Transport-Stream Player") ;Moves the application to screen co-ordinates to 0,0 WinMove("DekTec StreamXpress - Transport-Stream Player", "", 0, 0) ;Delay needed to ensure the dektec in moved to the left top corner Sleep(500) ;Reading the file -> $oExcel, Reading the row number -> $redvalue,Reading the column -> 2 If IsString($sCellValue)Then $sCellValue = _ExcelReadCell($oExcel, $redvalue, 2) MsgBox(0, "", "The Cell Value is: " & @CRLF & $sCellValue, 2) ElseIf $sCellValue = "" Then MsgBox(0, "", "The Cell number selected is invalid: ") EndIf ;This commented lines reads the current stream being played by the streamer xpress app ;local $getstreamervalue ;$getstreamervalue = ControlGetText("DekTec StreamXpress - Transport-Stream Player", "", "Edit1") ;MsgBox(0, "", "The stream being played is: " & @CRLF & $getstreamervalue, 2) ;This commented lines reads the current frequency selected in the streamer xpress app ;local $getstreamerfreq ;$getstreamerfreq = ControlGetText("Streamer set Frequency is:", "", "Edit2") ;MsgBox(0, "", "The streamer frequency Value is: " & @CRLF & $getstreamerfreq, 2) Local $setstream ;Button1 clicks the "open" button in Dektec app ControlClick("DekTec StreamXpress - Transport-Stream Player", "", "Button1") ;Activating the UI which appears after clicking the "open" button WinActivate("Open MPEG-2 Transport Stream") ;Delay provided to ensure the above window is launched sleep(2000) ;Setting the stream path read from "$sCellValue"(Excel file) onto the Text box(Edit1) before the Open button $setstream = ControlSetText ("Open MPEG-2 Transport Stream", " ", "Edit1", $sCellValue) ;MsgBox(0, "", "The Cell Value is: " & @CRLF & $sCellValue, 2) ;Delay provided to esnure the read stream path is copied onto the textbox(Edit1) sleep(1000) ;Pressing the Open button(Button2) to ensure the selected stream is opened in streamer application ControlClick("Open MPEG-2 Transport Stream", "", "Button2") ;MsgBox(0, "", "The stream being played is: " & @CRLF & $setstream, 2) WinActivate("TS-Automator") local $getappfreq ;Reading the frequency from our application and storing in $getappfreq $getappfreq = ControlGetText("TS-Automator", "", "Edit4") MsgBox(0, "", "The application frequency Value is: " & @CRLF & $getappfreq, 2) ;Copying the read frequency value to the streamer application(Edit6) text box $setappfreq = ControlSetText ( "DekTec StreamXpress - Transport-Stream Player", " ", "Edit6", $getappfreq) ;Ensuring the playback is stopped in streamer application ControlClick("DekTec StreamXpress - Transport-Stream Player", "", "Button21","left",2) sleep(1000) ;Ensuring the play button is pressed to start the current selected stream playback ControlClick("DekTec StreamXpress - Transport-Stream Player", "", "Button19","left",2) EndFunc Func Automate() $hGUI = GUICreate("Automate",450,500) GUICtrlCreateLabel("First Stream Path :",8,20,130,15) GUICtrlCreateLabel("Second Stream Path :",8,60,130,15) GUICtrlCreateLabel("Third Stream Path :",8,100,130,15) GUICtrlCreateLabel("Fourth Stream Path :",8,140,130,15) GUICtrlCreateLabel("Fifth Stream Path :",8,180,130,15) GUICtrlCreateLabel("Sixth Stream Path :",8,220,130,15) GUICtrlCreateLabel("Seventh Stream Path :",8,260,130,15) GUICtrlCreateLabel("Eighth Stream Path :",8,300,130,15) GUICtrlCreateLabel("Nineth Stream Path :",8,340,130,15) GUICtrlCreateLabel("Tenth Stream Path :",8,380,130,15) $readfirstautoedit = GUICtrlCreateInput("", 140,20,200,20) $hCombo1 = GUICtrlCreateCombo("473.000", 360, 20, 75, 20) ;Combo box with range of frequencies GUICtrlSetData(-1, "479.000|485.000|491.000|497.000|503.000|509.000|515.000|521.000|527.000|533.000|539.000|545.000|551.000|557.000|563.000|569.000|575.000|581.000|587.000|593.000|599.000|605.000|611.000|617.000|623.000|629.000|635.000|641.000|647.000|653.000|659.000|665.000|671.000|677.000|683.000|689.000|695.000|701.000|707.000|713.000|719.000|725.000|731.000|743.000|749.000|755.000|761.000|767.000", "") ; add other item snd set a new default $readsecondautoedit = GUICtrlCreateInput("",140,60,200,20) $hCombo2 = GUICtrlCreateCombo("473.000", 360, 60, 75, 20) ;Combo box with range of frequencies GUICtrlSetData(-1, "479.000|485.000|491.000|497.000|503.000|509.000|515.000|521.000|527.000|533.000|539.000|545.000|551.000|557.000|563.000|569.000|575.000|581.000|587.000|593.000|599.000|605.000|611.000|617.000|623.000|629.000|635.000|641.000|647.000|653.000|659.000|665.000|671.000|677.000|683.000|689.000|695.000|701.000|707.000|713.000|719.000|725.000|731.000|743.000|749.000|755.000|761.000|767.000", "") ; add other item snd set a new default $readthirdautoedit = GUICtrlCreateInput("",140,100,200,20) $hCombo3 = GUICtrlCreateCombo("473.000", 360, 100, 75, 20) ;Combo box with range of frequencies GUICtrlSetData(-1, "479.000|485.000|491.000|497.000|503.000|509.000|515.000|521.000|527.000|533.000|539.000|545.000|551.000|557.000|563.000|569.000|575.000|581.000|587.000|593.000|599.000|605.000|611.000|617.000|623.000|629.000|635.000|641.000|647.000|653.000|659.000|665.000|671.000|677.000|683.000|689.000|695.000|701.000|707.000|713.000|719.000|725.000|731.000|743.000|749.000|755.000|761.000|767.000", "") ; add other item snd set a new default $readfourthautoedit = GUICtrlCreateInput("",140,140,200,20) $hCombo4 = GUICtrlCreateCombo("473.000", 360, 140, 75, 20) ;Combo box with range of frequencies GUICtrlSetData(-1, "479.000|485.000|491.000|497.000|503.000|509.000|515.000|521.000|527.000|533.000|539.000|545.000|551.000|557.000|563.000|569.000|575.000|581.000|587.000|593.000|599.000|605.000|611.000|617.000|623.000|629.000|635.000|641.000|647.000|653.000|659.000|665.000|671.000|677.000|683.000|689.000|695.000|701.000|707.000|713.000|719.000|725.000|731.000|743.000|749.000|755.000|761.000|767.000", "") ; add other item snd set a new default $readfifthautoedit = GUICtrlCreateInput("",140,180,200,20) $hCombo5 = GUICtrlCreateCombo("473.000", 360, 180, 75, 20) ;Combo box with range of frequencies GUICtrlSetData(-1, "479.000|485.000|491.000|497.000|503.000|509.000|515.000|521.000|527.000|533.000|539.000|545.000|551.000|557.000|563.000|569.000|575.000|581.000|587.000|593.000|599.000|605.000|611.000|617.000|623.000|629.000|635.000|641.000|647.000|653.000|659.000|665.000|671.000|677.000|683.000|689.000|695.000|701.000|707.000|713.000|719.000|725.000|731.000|743.000|749.000|755.000|761.000|767.000", "") ; add other item snd set a new default $readsixthautoedit = GUICtrlCreateInput("",140,220,200,20) $hCombo6 = GUICtrlCreateCombo("473.000", 360, 220, 75, 20) ;Combo box with range of frequencies GUICtrlSetData(-1, "479.000|485.000|491.000|497.000|503.000|509.000|515.000|521.000|527.000|533.000|539.000|545.000|551.000|557.000|563.000|569.000|575.000|581.000|587.000|593.000|599.000|605.000|611.000|617.000|623.000|629.000|635.000|641.000|647.000|653.000|659.000|665.000|671.000|677.000|683.000|689.000|695.000|701.000|707.000|713.000|719.000|725.000|731.000|743.000|749.000|755.000|761.000|767.000", "") ; add other item snd set a new default $readseventhautoedit = GUICtrlCreateInput("",140,260,200,20) $hCombo7 = GUICtrlCreateCombo("473.000", 360, 260, 75, 20) ;Combo box with range of frequencies GUICtrlSetData(-1, "479.000|485.000|491.000|497.000|503.000|509.000|515.000|521.000|527.000|533.000|539.000|545.000|551.000|557.000|563.000|569.000|575.000|581.000|587.000|593.000|599.000|605.000|611.000|617.000|623.000|629.000|635.000|641.000|647.000|653.000|659.000|665.000|671.000|677.000|683.000|689.000|695.000|701.000|707.000|713.000|719.000|725.000|731.000|743.000|749.000|755.000|761.000|767.000", "") ; add other item snd set a new default $readeighthautoedit = GUICtrlCreateInput("",140,300,200,20) $hCombo8 = GUICtrlCreateCombo("473.000", 360, 300, 75, 20) ;Combo box with range of frequencies GUICtrlSetData(-1, "479.000|485.000|491.000|497.000|503.000|509.000|515.000|521.000|527.000|533.000|539.000|545.000|551.000|557.000|563.000|569.000|575.000|581.000|587.000|593.000|599.000|605.000|611.000|617.000|623.000|629.000|635.000|641.000|647.000|653.000|659.000|665.000|671.000|677.000|683.000|689.000|695.000|701.000|707.000|713.000|719.000|725.000|731.000|743.000|749.000|755.000|761.000|767.000", "") ; add other item snd set a new default $readninethautoedit = GUICtrlCreateInput("",140,340,200,20) $hCombo9 = GUICtrlCreateCombo("473.000", 360, 340, 75, 20) ;Combo box with range of frequencies GUICtrlSetData(-1, "479.000|485.000|491.000|497.000|503.000|509.000|515.000|521.000|527.000|533.000|539.000|545.000|551.000|557.000|563.000|569.000|575.000|581.000|587.000|593.000|599.000|605.000|611.000|617.000|623.000|629.000|635.000|641.000|647.000|653.000|659.000|665.000|671.000|677.000|683.000|689.000|695.000|701.000|707.000|713.000|719.000|725.000|731.000|743.000|749.000|755.000|761.000|767.000", "") ; add other item snd set a new default $readTenthautoedit = GUICtrlCreateInput("",140,380,200,20) $hCombo10 = GUICtrlCreateCombo("473.000", 360, 380, 75, 20) ;Combo box with range of frequencies GUICtrlSetData(-1, "479.000|485.000|491.000|497.000|503.000|509.000|515.000|521.000|527.000|533.000|539.000|545.000|551.000|557.000|563.000|569.000|575.000|581.000|587.000|593.000|599.000|605.000|611.000|617.000|623.000|629.000|635.000|641.000|647.000|653.000|659.000|665.000|671.000|677.000|683.000|689.000|695.000|701.000|707.000|713.000|719.000|725.000|731.000|743.000|749.000|755.000|761.000|767.000", "") ; add other item snd set a new default $Mobility= GUICtrlCreateCheckbox("Mobility", 290, 433, 120, 20) GUICtrlGetState($Mobility) ;Creating the delay button GUICtrlCreateLabel("Delay",60,439,30,25) $delay = GUICtrlCreateInput("", 90,433 ,30,20) ;Loop button checkbox $chkbox = GUICtrlCreateCheckbox("Loop", 170, 433, 120, 20) GUICtrlGetState($chkbox) ;Creating the Start button $Startappbuttn = GUICtrlCreateButton("Start",55,460,70) ;The object refers to the already defined Exit button $exitappbuttn = GUICtrlCreateButton("Exit",165,460,70) GUISetState() EndFunc Func Batch() if WinExists("Automate") Then WinActivate("Automate") $read = GUICtrlRead($chkbox);Check if the user has enabled the loop option $MobilityRead=GUICtrlRead($Mobility) if $read = $GUI_CHECKED Then While(1) $userdelay = GUICtrlRead($delay);Read the delay entered by the user If (Int($userdelay)) Then msgbox(0,"Delay","User defined delay is:"& @CRLF & $userdelay,1) If $MobilityRead = $GUI_CHECKED Then Mobility() Else setstream() Endif Else MsgBox(16, "Error", "Please enter numeric values only") EndIf WEnd Else $userdelay = GUICtrlRead($delay);Read the delay entered by the user If (Int($userdelay)) Then msgbox(0,"Delay","User defined delay is:"& @CRLF & $userdelay,1) If $MobilityRead = $GUI_CHECKED Then Mobility() Else setstream() Endif Else MsgBox(16, "Error", "Please enter numeric values only") EndIf EndIf Endif EndFunc Func getvalues() ;reading the values from the text box for all the paths in Automate screen $firstvalue = GUICtrlRead($readfirstautoedit) $secondvalue = GUICtrlRead($readsecondautoedit) $thirdvalue = GUICtrlRead($readthirdautoedit) $fourthvalue = GUICtrlRead($readfourthautoedit) $fifthvalue = GUICtrlRead($readfifthautoedit) $sixthvalue = GUICtrlRead($readsixthautoedit) $seventhvalue = GUICtrlRead($readseventhautoedit) $eigthvalue = GUICtrlRead($readeighthautoedit) $ninethvalue = GUICtrlRead($readninethautoedit) EndFunc Func setstream() getvalues() Local $Frequency $Frequency = ControlGetText("Automate", "", "Edit2") MsgBox(0,"Frequency",$Frequency,1 ) ;Copying the read frequency value to the streamer application(Edit6) text box Local $setfreq = ControlSetText ( "DekTec StreamXpress - Transport-Stream Player", " ", "Edit6", $Frequency) Local $i for $i = 0 to 9 step 1 Local $path[50] = [$firstvalue, $secondvalue,$thirdvalue,$fourthvalue,$fifthvalue,$sixthvalue,$seventhvalue,$eigthvalue,$ninethvalue,$tenthvalue] ;Activates the already opened Dektec application WinActivate("DekTec StreamXpress - Transport-Stream Player") ;Button1 clicks the "open" button in Dektec app sleep(1000) ControlClick("DekTec StreamXpress - Transport-Stream Player", "", "Button1") ;Activating the UI which appears after clicking the "open" button sleep(1000) WinActivate("Open MPEG-2 Transport Stream") ;Setting the stream path read from the Automate UI onto the Text box(Edit1) before the Open button $copystream = ControlSetText ("Open MPEG-2 Transport Stream", " ", "Edit1", $path[$i]) sleep(1000) ;~ MsgBox(0, "", "The stream being played is: " & @CRLF & $path[$i] , 1) sleep(1000) ControlClick("Open MPEG-2 Transport Stream", "", "Button2") ;Ensuring the playback is stopped in streamer application ControlClick("DekTec StreamXpress - Transport-Stream Player", "", "Button21","left",2) sleep(1000) ;Ensuring the play button is pressed to start the current selected stream playback ControlClick("DekTec StreamXpress - Transport-Stream Player", "", "Button19","left",2) ;These lines read the current stream being played by the streamer xpress app local $getstreamervalue $getstreamervalue = ControlGetText("DekTec StreamXpress - Transport-Stream Player", "", "Edit1") ;~ MsgBox(0, "", "The stream being played is in streamer is: " & @CRLF & $getstreamervalue, 2) sleep($userdelay) Next EndFunc Func Mobility() $firstvalue = GUICtrlRead($readfirstautoedit) ;Activates the already opened Dektec application WinActivate("DekTec StreamXpress - Transport-Stream Player") ;Button1 clicks the "open" button in Dektec app sleep(1000) ControlClick("DekTec StreamXpress - Transport-Stream Player", "", "Button1") ;Activating the UI which appears after clicking the "open" button ;~ sleep(1000) WinActivate("Open MPEG-2 Transport Stream") ;Setting the stream path read from the Automate UI onto the Text box(Edit1) before the Open button $copystream = ControlSetText ("Open MPEG-2 Transport Stream", " ", "Edit1", $firstvalue) sleep(1000) MsgBox(0, "", "The stream being played is: " & @CRLF & $firstvalue , 1) sleep(1000) ControlClick("Open MPEG-2 Transport Stream", "", "Button2") ;These lines read the current stream being played by the streamer xpress app local $getstreamervalue $getstreamervalue = ControlGetText("DekTec StreamXpress - Transport-Stream Player", "", "Edit1") ;~ MsgBox(0, "", "The stream being played is in streamer is: " & @CRLF & $getstreamervalue, 2) for $j=0 To 9 local $getMFNfreq ;Reading the frequency from our application and storing in $getappfreq $getMFNfreq = ControlGetText("Automate", "", $Class[$j]) MsgBox(0,"Frequency",$getMFNfreq,1 ) ;Copying the read frequency value to the streamer application(Edit6) text box Local $setappfreq = ControlSetText ( "DekTec StreamXpress - Transport-Stream Player", " ", "Edit6", $getMFNfreq) ;Ensuring the playback is stopped in streamer application ControlClick("DekTec StreamXpress - Transport-Stream Player", "", "Button21","left",2) sleep(2000) ;Ensuring the play button is pressed to start the current selected stream playback ControlClick("DekTec StreamXpress - Transport-Stream Player", "", "Button19","left",2) sleep($userdelay) Next EndFunc While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE WinActivate("Microsoft Excel - AllStreamDetails.xls") _ExcelBookClose($oExcel,0) Exit Case $msg = $setvaluebuttn validate() Case $msg = $Automateappbuttn Automate() Case $msg = $Startappbuttn Batch() Case $msg = $infoitem About() Case $msg = $OKappbutton Exitabout() Case $msg = $exitappbuttn _ExcelBookClose($oExcel,0) Exit EndSelect WEnd ======================================================================================================================================== Thanks
  5. Hi, Am facing problem is clicking the below buttons in the main window of my UI. The buttons which am not able to click using my mouse are: - SetValue - Exit - Automate Using the tab key on keyboard I can click but not through mouse. Also When I click on Automate button I expect the Automate UI to be launched where as it is disappearing off. Pl create an excel file by name "AllStreamDetails.xls" on your desktop and copy the below pasted script onto your desktop before checking the above stated problem. Thanks *************************************************************************************************************************************************************** #include <Excel.au3> ;library for doing excel operations #include <GUIConstantsEx.au3> #include <Misc.au3> #include <Array.au3> #include <file.au3> #include-Once ;~ Opt("GUIOnEventMode", 1) Opt("GUICoordMode", 1) local $readedit,$mylist, $read Global $currentlistselection,$hCombo, $chkbox, $module, $mod, $modulator, $modip, $OKappbutton,$infoitem, $MFN, $Affiliation ;$redvalue is the variable which accepts the 3 digit numerals for reading the row numbers from excel file Global $redvalue = String(3),$oExcelclose,$sCellValue,$oExcel,$Startappbutton,$test,$setvaluebuttn,$Automateappbuttn,$msg,$exitappbuttn Global $readfirstautoedit,$readsecondautoedit,$readthirdautoedit,$readfourthautoedit,$readfifthautoedit,$readsixthautoedit,$readseventhautoedit,$readeighthautoedit,$readninethautoedit,$readTenthautoedit Global $copystream,$delay,$userdelay,$firstvalue,$secondvalue,$thirdvalue,$fourthvalue,$fifthvalue,$fifthvalue,$sixthvalue,$seventhvalue,$eigthvalue,$ninethvalue,$tenthvalue Global $hCombo1,$hCombo2,$hCombo3,$hCombo4,$hCombo5,$hCombo6,$hCombo7,$hCombo8,$hCombo9,$hCombo10 ;Checking to see if the AllStreamDetails.xls is already opened If WinExists("Microsoft Excel - AllStreamDetails_1.xls") Then MsgBox(0, "", "The Excel file is already open") Else ;Reading the files from Desktop ;This file should already exist on the desktop $sFilePath1 = @DesktopDir & "\AllStreamDetails_1.xls" ;Opening the Excel file $oExcel = _ExcelBookOpen($sFilePath1) EndIf ;Error handling in case the excel file is not existing If @error = 1 Then MsgBox(0, "Error!", "Unable to Create the Excel Object") Exit ElseIf @error = 2 Then MsgBox(0, "Error!", "File does not exist - Please copy the AllStreamDetails.xls onto your desktop and try") Exit; EndIf ;Calling the GUI create function createGUI() Func createGUI() $hGUI = GUICreate("TS-Automator",380,220) GUICtrlCreateLabel("Enter the Modulator:",10,30,250,75) ;Combo box with default value as 172.24.18.114 $modulator = GUICtrlCreateCombo("172.24.18.114", 270, 20, 105, 40) ;Combo box with the range of Modulators GUICtrlSetData(-1, "172.24.18.118|172.24.18.239","") GUICtrlCreateLabel("Enter the Module:",10,55,250,75) ;Combo box with default value as EMM $module = GUICtrlCreateCombo("[EMM]", 270, 45, 105, 40) ;Combo box with the range of Modules GUICtrlSetData(-1, "[EWS]|[special Service]|[Parental Rating]|[Region ID]|[Version Change]|[LOGO]|[Frequency List]|[OAD]|[superimpose]|[Caption]|[EPG]|[Partial Stream]|[Audio Toggling]|[Others]","") GUICtrlCreateLabel("Enter the Row Number of the stream to be loaded :",10,80,250,75) Global $readedit = GUICtrlCreateInput(" ",270,75,75,20) GUICtrlCreateLabel("Select the Frequency to be set from the list:",10,110,250,75) ;Combo box with default value as 473.000 Global $hCombo = GUICtrlCreateCombo("473.000", 270, 100, 75, 20) ;Combo box with range of frequencies GUICtrlSetData(-1, "479.000|485.000|491.000|497.000|503.000|509.000|515.000|521.000|527.000|533.000|539.000|545.000|551.000|557.000|563.000|569.000|575.000|581.000|587.000|593.000|599.000|605.000|611.000|617.000|623.000|629.000|635.000|641.000|647.000|653.000|659.000|665.000|671.000|677.000|683.000|689.000|695.000|701.000|707.000|713.000|719.000|725.000|731.000|743.000|749.000|755.000|761.000|767.000", "") ; add other item snd set a new default $Automateappbuttn = GUICtrlCreateButton("Automate",220,150,70) ;~ GUISetOnEvent(-1,'Automate') $setvaluebuttn = GUICtrlCreateButton("Set Value",30,150,70,25) ;~ GUISetOnEvent(-1,"validate") $exitappbuttn = GUICtrlCreateButton("Exit",120,150,70) $helpmenu = GUICtrlCreateMenu("About") ;creating the info sub menu $infoitem = GUICtrlCreateMenuItem("Info", $helpmenu) ;on selecting info from sub-menu this should point to About function ;GUICtrlSetOnEvent($infoitem, "About") ;Making the GUI visible to the end user GUISetState() ;~ sleep(2000) ;~ While($msg <> $setvaluebuttn) ;~ readmodule() ;~ Search() ;~ WEnd EndFunc Func About() GUICreate("About",320,145) Local $Msgfonts $Msgfonts = "Comic Sans MS" GUISetFont(8, 500, 0, $Msgfonts) GUICtrlCreateLabel("** Developed by Vishwas K S and Chandana Prakash of CSG-SQE ** ", 5, 30) GUICtrlCreateLabel("** LG Soft India Pvt Ltd ** ", 5, 50) GUICtrlCreateLabel("** Version : 0.0a ** ", 5, 70) GUISetFont(7, 400, 0, $Msgfonts) GUISetState() $OKappbutton = GUICtrlCreateButton("OK", 120, 100, 80) ;~ GUICtrlSetOnEvent(-1, "Exitabout") EndFunc Func readmodule() $modip = GUICtrlRead($modulator); read the Modulator IP chosen by the user. ;Activate the particular sheet in All Stream Details depending on the Modulator IP chosen by the user. Select Case $modip = "172.24.18.114" _ExcelSheetActivate($oExcel, "ISDB-T Stream Details_Mod-114") Case $modip = "172.24.18.118" _ExcelSheetActivate($oExcel, "ISDB-T Stream Details_Mod-118") Case $modip = "172.24.18.239" _ExcelSheetActivate($oExcel, "ISDB-T Stream Details_Mod-239") EndSelect EndFunc ;This function validates the user entry of the Excel row number based on positive value calls the setvalue function Func validate() $redvalue = GUICtrlRead($readedit) If(Int($redvalue)) Then Initiate() Else MsgBox(16, "Error", "Please enter numeric values only") GUICtrlSetData($readedit,"") EndIf EndFunc Func Automate() $hGUI = GUICreate("Automate",450,500) GUICtrlCreateLabel("First Stream Path :",8,20,250,75) GUICtrlCreateLabel("Second Stream Path :",8,60,250,75) GUICtrlCreateLabel("Third Stream Path :",8,100,250,75) GUICtrlCreateLabel("Fourth Stream Path :",8,140,250,75) GUICtrlCreateLabel("Fifth Stream Path :",8,180,250,75) GUICtrlCreateLabel("Sixth Stream Path :",8,220,250,75) GUICtrlCreateLabel("Seventh Stream Path :",8,260,250,75) GUICtrlCreateLabel("Eighth Stream Path :",8,300,250,75) GUICtrlCreateLabel("Nineth Stream Path :",8,340,250,75) GUICtrlCreateLabel("Tenth Stream Path :",8,380,250,75) $readfirstautoedit = GUICtrlCreateInput("", 140,20,200,20) $hCombo1 = GUICtrlCreateCombo("473.000", 360, 20, 75, 20) ;Combo box with range of frequencies GUICtrlSetData(-1, "479.000|485.000|491.000|497.000|503.000|509.000|515.000|521.000|527.000|533.000|539.000|545.000|551.000|557.000|563.000|569.000|575.000|581.000|587.000|593.000|599.000|605.000|611.000|617.000|623.000|629.000|635.000|641.000|647.000|653.000|659.000|665.000|671.000|677.000|683.000|689.000|695.000|701.000|707.000|713.000|719.000|725.000|731.000|743.000|749.000|755.000|761.000|767.000", "") ; add other item snd set a new default $readsecondautoedit = GUICtrlCreateInput("",140,60,200,20) $hCombo2 = GUICtrlCreateCombo("473.000", 360, 60, 75, 20) ;Combo box with range of frequencies GUICtrlSetData(-1, "479.000|485.000|491.000|497.000|503.000|509.000|515.000|521.000|527.000|533.000|539.000|545.000|551.000|557.000|563.000|569.000|575.000|581.000|587.000|593.000|599.000|605.000|611.000|617.000|623.000|629.000|635.000|641.000|647.000|653.000|659.000|665.000|671.000|677.000|683.000|689.000|695.000|701.000|707.000|713.000|719.000|725.000|731.000|743.000|749.000|755.000|761.000|767.000", "") ; add other item snd set a new default $readthirdautoedit = GUICtrlCreateInput("",140,100,200,20) $hCombo3 = GUICtrlCreateCombo("473.000", 360, 100, 75, 20) ;Combo box with range of frequencies GUICtrlSetData(-1, "479.000|485.000|491.000|497.000|503.000|509.000|515.000|521.000|527.000|533.000|539.000|545.000|551.000|557.000|563.000|569.000|575.000|581.000|587.000|593.000|599.000|605.000|611.000|617.000|623.000|629.000|635.000|641.000|647.000|653.000|659.000|665.000|671.000|677.000|683.000|689.000|695.000|701.000|707.000|713.000|719.000|725.000|731.000|743.000|749.000|755.000|761.000|767.000", "") ; add other item snd set a new default $readfourthautoedit = GUICtrlCreateInput("",140,140,200,20) $hCombo4 = GUICtrlCreateCombo("473.000", 360, 140, 75, 20) ;Combo box with range of frequencies GUICtrlSetData(-1, "479.000|485.000|491.000|497.000|503.000|509.000|515.000|521.000|527.000|533.000|539.000|545.000|551.000|557.000|563.000|569.000|575.000|581.000|587.000|593.000|599.000|605.000|611.000|617.000|623.000|629.000|635.000|641.000|647.000|653.000|659.000|665.000|671.000|677.000|683.000|689.000|695.000|701.000|707.000|713.000|719.000|725.000|731.000|743.000|749.000|755.000|761.000|767.000", "") ; add other item snd set a new default $readfifthautoedit = GUICtrlCreateInput("",140,180,200,20) $hCombo5 = GUICtrlCreateCombo("473.000", 360, 180, 75, 20) ;Combo box with range of frequencies GUICtrlSetData(-1, "479.000|485.000|491.000|497.000|503.000|509.000|515.000|521.000|527.000|533.000|539.000|545.000|551.000|557.000|563.000|569.000|575.000|581.000|587.000|593.000|599.000|605.000|611.000|617.000|623.000|629.000|635.000|641.000|647.000|653.000|659.000|665.000|671.000|677.000|683.000|689.000|695.000|701.000|707.000|713.000|719.000|725.000|731.000|743.000|749.000|755.000|761.000|767.000", "") ; add other item snd set a new default $readsixthautoedit = GUICtrlCreateInput("",140,220,200,20) $hCombo6 = GUICtrlCreateCombo("473.000", 360, 220, 75, 20) ;Combo box with range of frequencies GUICtrlSetData(-1, "479.000|485.000|491.000|497.000|503.000|509.000|515.000|521.000|527.000|533.000|539.000|545.000|551.000|557.000|563.000|569.000|575.000|581.000|587.000|593.000|599.000|605.000|611.000|617.000|623.000|629.000|635.000|641.000|647.000|653.000|659.000|665.000|671.000|677.000|683.000|689.000|695.000|701.000|707.000|713.000|719.000|725.000|731.000|743.000|749.000|755.000|761.000|767.000", "") ; add other item snd set a new default $readseventhautoedit = GUICtrlCreateInput("",140,260,200,20) $hCombo7 = GUICtrlCreateCombo("473.000", 360, 260, 75, 20) ;Combo box with range of frequencies GUICtrlSetData(-1, "479.000|485.000|491.000|497.000|503.000|509.000|515.000|521.000|527.000|533.000|539.000|545.000|551.000|557.000|563.000|569.000|575.000|581.000|587.000|593.000|599.000|605.000|611.000|617.000|623.000|629.000|635.000|641.000|647.000|653.000|659.000|665.000|671.000|677.000|683.000|689.000|695.000|701.000|707.000|713.000|719.000|725.000|731.000|743.000|749.000|755.000|761.000|767.000", "") ; add other item snd set a new default $readeighthautoedit = GUICtrlCreateInput("",140,300,200,20) $hCombo8 = GUICtrlCreateCombo("473.000", 360, 300, 75, 20) ;Combo box with range of frequencies GUICtrlSetData(-1, "479.000|485.000|491.000|497.000|503.000|509.000|515.000|521.000|527.000|533.000|539.000|545.000|551.000|557.000|563.000|569.000|575.000|581.000|587.000|593.000|599.000|605.000|611.000|617.000|623.000|629.000|635.000|641.000|647.000|653.000|659.000|665.000|671.000|677.000|683.000|689.000|695.000|701.000|707.000|713.000|719.000|725.000|731.000|743.000|749.000|755.000|761.000|767.000", "") ; add other item snd set a new default $readninethautoedit = GUICtrlCreateInput("",140,340,200,20) $hCombo9 = GUICtrlCreateCombo("473.000", 360, 340, 75, 20) ;Combo box with range of frequencies GUICtrlSetData(-1, "479.000|485.000|491.000|497.000|503.000|509.000|515.000|521.000|527.000|533.000|539.000|545.000|551.000|557.000|563.000|569.000|575.000|581.000|587.000|593.000|599.000|605.000|611.000|617.000|623.000|629.000|635.000|641.000|647.000|653.000|659.000|665.000|671.000|677.000|683.000|689.000|695.000|701.000|707.000|713.000|719.000|725.000|731.000|743.000|749.000|755.000|761.000|767.000", "") ; add other item snd set a new default $readTenthautoedit = GUICtrlCreateInput("",140,380,200,20) $hCombo10 = GUICtrlCreateCombo("473.000", 360, 380, 75, 20) ;Combo box with range of frequencies GUICtrlSetData(-1, "479.000|485.000|491.000|497.000|503.000|509.000|515.000|521.000|527.000|533.000|539.000|545.000|551.000|557.000|563.000|569.000|575.000|581.000|587.000|593.000|599.000|605.000|611.000|617.000|623.000|629.000|635.000|641.000|647.000|653.000|659.000|665.000|671.000|677.000|683.000|689.000|695.000|701.000|707.000|713.000|719.000|725.000|731.000|743.000|749.000|755.000|761.000|767.000", "") ; add other item snd set a new default $MFN = GUICtrlCreateRadio("MFN", 290, 433, 120, 20) GUICtrlGetState($MFN) $Affiliation = GUICtrlCreateRadio("Affiliation", 290, 460, 120, 20) GUICtrlGetState($Affiliation) ;Creating the delay button GUICtrlCreateLabel("Delay",60,439,30,25) Global $delay = GUICtrlCreateInput("", 90,433 ,30,20) ;~ ;Loop button checkbox $chkbox = GUICtrlCreateCheckbox("Loop", 170, 433, 120, 20) GUICtrlGetState($chkbox) ;Creating the Start button $Startappbutton = GUICtrlCreateButton("Start",55,460,70) ;The object refers to the already defined Exit button $exitappbuttn = GUICtrlCreateButton("Exit",165,460,70) GUISetState() EndFunc Func getvalues() ;Global $firstvalue,$secondvalue,$thirdvalue,$fourthvalue,$fifthvalue,$fifthvalue,$sixthvalue,$seventhvalue,$eigthvalue,$ninethvalue,$tenthvalue ;reading the values from the text box for all the paths in Automate screen $firstvalue = GUICtrlRead($readfirstautoedit) $secondvalue = GUICtrlRead($readsecondautoedit) $thirdvalue = GUICtrlRead($readthirdautoedit) $fourthvalue = GUICtrlRead($readfourthautoedit) $fifthvalue = GUICtrlRead($readfifthautoedit) $sixthvalue = GUICtrlRead($readsixthautoedit) $seventhvalue = GUICtrlRead($readseventhautoedit) $eigthvalue = GUICtrlRead($readeighthautoedit) $ninethvalue = GUICtrlRead($readninethautoedit) $tenthvalue = GUICtrlRead($readTenthautoedit) EndFunc ;Batch() Func Batch() if WinExists("Automate") Then WinActivate("Automate") $read = GUICtrlRead($chkbox);Check if the user has enabled the loop option if $read = $GUI_CHECKED Then While(1) $userdelay = GUICtrlRead($delay);Read the delay entered by the user getvalues() If (Int($userdelay)) Then msgbox(0,"Delay","User defined delay is:"& @CRLF & $userdelay,2) ;~ MsgBox(0, "", "The stream being here is: " & @CRLF & $firstvalue, 2) ;~ MsgBox(0, "", "The stream being here is: " & @CRLF & $secondvalue, 2) ;~ MsgBox(0, "", "The stream being here is: " & @CRLF & $thirdvalue, 2) ;~ MsgBox(0, "", "The stream being here is: " & @CRLF & $fourthvalue, 2) ;~ MsgBox(0, "", "The stream being here is: " & @CRLF & $fifthvalue, 2) ;~ MsgBox(0, "", "The stream being here is: " & @CRLF & $sixthvalue, 2) ;~ MsgBox(0, "", "The stream being here is: " & @CRLF & $seventhvalue, 2) ;~ MsgBox(0, "", "The stream being here is: " & @CRLF & $eigthvalue, 2) ;~ MsgBox(0, "", "The stream being here is: " & @CRLF & $ninethvalue, 2) ;~ MsgBox(0, "", "The stream being here is: " & @CRLF & $tenthvalue, 2) setstream() Else MsgBox(16, "Error", "Please enter numeric values only") EndIf WEnd Else $userdelay = GUICtrlRead($delay);Read the delay entered by the user getvalues() If (Int($userdelay)) Then msgbox(0,"Delay","User defined delay is:"& @CRLF & $userdelay,2) Mobility() Else MsgBox(16, "Error", "Please enter numeric values only") EndIf EndIf Endif EndFunc Func Initiate() $char = GUICtrlRead($readedit);Read the row number $modip = GUICtrlRead($modulator);Read the modulator chosen by the user Select Case $modip = "172.24.18.114" ;Checking for Invalid rows If ($char <> 1 Or $char<>2 Or $char<>6 Or $char<>11 Or $char<>15 Or $char<>25 Or $char<>30 Or $char<>34 Or $char<>47 Or $char<>63 Or $char<>76 Or $char<>79 Or $char<>114 Or $char<>164 Or $char<>168 Or $char<>182 Or $char<189) Then ;Proceed if valid row number is chosen WinActivate("Microsoft Excel - AllStreamDetails.xls") $characteristics = _ExcelReadCell($oExcel,$char,4) MsgBox(0,"Characteristics",$characteristics);Display the characteristics of the selected stream setvalue() Else MsgBox(0,"Error","Invalid Row number selected") ControlSetText("[CLASS:AutoIt v3 GUI]","","Edit3","") sleep(3000) readmodule() EndIf Case $modip = "172.24.18.118" ;Checking for Invalid rows If ($char <> 1 Or $char<>2 Or $char<>7 Or $char<>17 Or $char<>21 Or $char<>31 Or $char<>36 Or $char<>40 Or $char<>53 Or $char<>69 Or $char<>87 Or $char<>90 Or $char<>122 Or $char<>175 Or $char<>179 Or $char<>195 Or $char<203) Then ;Proceed if valid row number is chosen. WinActivate("Microsoft Excel - AllStreamDetails.xls") $characteristics = _ExcelReadCell($oExcel,$char,4) MsgBox(0,"Characteristics",$characteristics);Display the characteristics of the selected stream. setvalue() Else MsgBox(0,"Error","Invalid Row number selected") ControlSetText("[CLASS:AutoIt v3 GUI]","","Edit3","") sleep(3000) readmodule() EndIf Case $modip = "172.24.18.239" ;Checking for Invalid rows If ($char <> 1 Or $char<>2 Or $char<>6 Or $char<>11 Or $char<>15 Or $char<>25 Or $char<>30 Or $char<>34 Or $char<>44 Or $char<>53 Or $char<>56 Or $char<>58 Or $char<>77 Or $char<>101 Or $char<>104 Or $char<>114 Or $char<118) Then ;Proceed if valid row number is chosen. WinActivate("Microsoft Excel - AllStreamDetails.xls") $characteristics = _ExcelReadCell($oExcel,$char,4) MsgBox(0,"Characteristics",$characteristics);Display the characteristics of the selected stream. setvalue() Else MsgBox(0,"Error","Invalid Row number selected") ControlSetText("[CLASS:AutoIt v3 GUI]","","Edit3","") sleep(3000) readmodule() EndIf EndSelect EndFunc Func setvalue() ;~ ;If condition which reads the combobox to find the current selection If GUICtrlRead($hCombo) <> $currentlistselection Then ;Reads the new selection value to $hCombo variable $currentlistselection = GUICtrlRead($hCombo) ;MsgBox(0, "", "The Cell Value is: " & @CRLF & $currentlistselection, 2) EndIf ;Activates the already opened Dektec application WinActivate("DekTec StreamXpress - Transport-Stream Player") ;Moves the application to screen co-ordinates to 0,0 WinMove("DekTec StreamXpress - Transport-Stream Player", "", 0, 0) ;Delay needed to ensure the dektec in moved to the left top corner Sleep(500) ;Reading the file -> $oExcel, Reading the row number -> $redvalue,Reading the column -> 2 If IsString($sCellValue)Then $sCellValue = _ExcelReadCell($oExcel, $redvalue, 2) MsgBox(0, "", "The Cell Value is: " & @CRLF & $sCellValue, 2) ElseIf $sCellValue = "" Then MsgBox(0, "", "The Cell number selected is invalid: ") EndIf ;This commented lines reads the current stream being played by the streamer xpress app ;local $getstreamervalue ;$getstreamervalue = ControlGetText("DekTec StreamXpress - Transport-Stream Player", "", "Edit1") ;MsgBox(0, "", "The stream being played is: " & @CRLF & $getstreamervalue, 2) ;This commented lines reads the current frequency selected in the streamer xpress app ;local $getstreamerfreq ;$getstreamerfreq = ControlGetText("Streamer set Frequency is:", "", "Edit2") ;MsgBox(0, "", "The streamer frequency Value is: " & @CRLF & $getstreamerfreq, 2) Local $setstream ;Button1 clicks the "open" button in Dektec app ControlClick("DekTec StreamXpress - Transport-Stream Player", "", "Button1") ;Activating the UI which appears after clicking the "open" button WinActivate("Open MPEG-2 Transport Stream") ;Delay provided to ensure the above window is launched sleep(2000) ;Setting the stream path read from "$sCellValue"(Excel file) onto the Text box(Edit1) before the Open button $setstream = ControlSetText ("Open MPEG-2 Transport Stream", " ", "Edit1", $sCellValue) ;MsgBox(0, "", "The Cell Value is: " & @CRLF & $sCellValue, 2) ;Delay provided to esnure the read stream path is copied onto the textbox(Edit1) sleep(1000) ;Pressing the Open button(Button2) to ensure the selected stream is opened in streamer application ControlClick("Open MPEG-2 Transport Stream", "", "Button2") ;MsgBox(0, "", "The stream being played is: " & @CRLF & $setstream, 2) ;WinActivate("DekTec StreamXpress - Transport-Stream Player") WinActivate("TS-Automator") local $getappfreq ;Reading the frequency from our application and storing in $getappfreq $getappfreq = ControlGetText("TS-Automator", "", "Edit4") MsgBox(0, "", "The application frequency Value is: " & @CRLF & $getappfreq, 2) Global $setappfreq ;Copying the read frequency value to the streamer application(Edit6) text box $setappfreq = ControlSetText ( "DekTec StreamXpress - Transport-Stream Player", " ", "Edit6", $getappfreq) ;Ensuring the playback is stopped in streamer application ControlClick("DekTec StreamXpress - Transport-Stream Player", "", "Button21","left",2) sleep(1000) ;Ensuring the play button is pressed to start the current selected stream playback ControlClick("DekTec StreamXpress - Transport-Stream Player", "", "Button19","left",2) EndFunc Func setstream() Local $i Global $path[50] = [$firstvalue, $secondvalue,$thirdvalue,$fourthvalue,$fifthvalue,$sixthvalue,$seventhvalue,$eigthvalue,$ninethvalue,$tenthvalue] for $i = 0 to 9 step 1 ;Activates the already opened Dektec application WinActivate("DekTec StreamXpress - Transport-Stream Player") ;Button1 clicks the "open" button in Dektec app ControlClick("DekTec StreamXpress - Transport-Stream Player", "", "Button1") ;Activating the UI which appears after clicking the "open" button WinActivate("Open MPEG-2 Transport Stream") ;Setting the stream path read from the Automate UI onto the Text box(Edit1) before the Open button $copystream = ControlSetText ("Open MPEG-2 Transport Stream", " ", "Edit1", $path[$i]) MsgBox(0, "", "The stream being played is: " & @CRLF & $path[$i] , 2) ;~ sleep(1000) ControlClick("Open MPEG-2 Transport Stream", "", "Button2") ;Ensuring the playback is stopped in streamer application ControlClick("DekTec StreamXpress - Transport-Stream Player", "", "Button21","left",2) ;~ sleep(1000) ;Ensuring the play button is pressed to start the current selected stream playback ControlClick("DekTec StreamXpress - Transport-Stream Player", "", "Button19","left",2) ;These lines read the current stream being played by the streamer xpress app local $getstreamervalue $getstreamervalue = ControlGetText("DekTec StreamXpress - Transport-Stream Player", "", "Edit1") ;~ MsgBox(0, "", "The stream being played is in streamer is: " & @CRLF & $getstreamervalue, 2) sleep($userdelay) Next EndFunc ;This function is used to search the location of the module name entered by the user and highlight it. Func Search() Local $i, $concat $mod = GUICtrlRead($module) For $i = 2 To 205 $readmodule = _ExcelReadCell($oExcel,$i,1) If($mod = $readmodule) Then $concat = "A" & $i $oExcel.Activesheet.Range($concat).select ;~ MsgBox(0,"Module read from the Stream details",$readmodule ) EndIf Next EndFunc ;~ Exitabout() ;~ Func Exitabout() ;~ ;deleting the launched About UI ;~ GUIDelete() ;~ EndFunc Func Mobility() Local $MFNRead,$AffRead $MFNRead=GUICtrlRead($MFN) $AffRead=GUICtrlRead($Affiliation) If $MFNRead= $GUI_CHECKED AND $AffRead = $GUI_CHECKED Then Msgbox(0,"Error","Check either MFN or Affiliation") ElseIf $MFNRead = $GUI_CHECKED OR $AffRead = $GUI_CHECKED Then $firstvalue = GUICtrlRead($readfirstautoedit) ;Activates the already opened Dektec application WinActivate("DekTec StreamXpress - Transport-Stream Player") ;Button1 clicks the "open" button in Dektec app ControlClick("DekTec StreamXpress - Transport-Stream Player", "", "Button1") ;Activating the UI which appears after clicking the "open" button WinActivate("Open MPEG-2 Transport Stream") ;Setting the stream path read from the Automate UI onto the Text box(Edit1) before the Open button $copystream = ControlSetText ("Open MPEG-2 Transport Stream", " ", "Edit1", $firstvalue) MsgBox(0, "", "The stream being played is: " & @CRLF & $firstvalue , 2) ;~ sleep(1000) ControlClick("Open MPEG-2 Transport Stream", "", "Button2") ;These lines read the current stream being played by the streamer xpress app local $getstreamervalue $getstreamervalue = ControlGetText("DekTec StreamXpress - Transport-Stream Player", "", "Edit1") ;~ MsgBox(0, "", "The stream being played is in streamer is: " & @CRLF & $getstreamervalue, 2) for $j=0 To 9 Global $Class[50] = ["Edit2","Edit4","Edit6","Edit8","Edit10","Edit12","Edit14","Edit16","Edit18","Edit20"] local $getMFNfreq ;Reading the frequency from our application and storing in $getappfreq $getMFNfreq = ControlGetText("Automate", "", $Class[$j]) MsgBox(0,"Frequency",$getMFNfreq ) ;Copying the read frequency value to the streamer application(Edit6) text box Local $setappfreq = ControlSetText ( "DekTec StreamXpress - Transport-Stream Player", " ", "Edit6", $getMFNfreq) ;Ensuring the playback is stopped in streamer application ControlClick("DekTec StreamXpress - Transport-Stream Player", "", "Button21","left",2) ;~ sleep(1000) ;Ensuring the play button is pressed to start the current selected stream playback ControlClick("DekTec StreamXpress - Transport-Stream Player", "", "Button19","left",2) sleep($userdelay) Next Else setstream() Endif EndFunc While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE WinActivate("Microsoft Excel - AllStreamDetails.xls") _ExcelBookClose($oExcel,0) Exit Case $msg = $infoitem About() Case $msg = $setvaluebuttn validate() Case $msg = $Automateappbuttn Automate() Case $msg = $Startappbutton getvalues() Case $msg = $OKappbutton GUIDelete() Case $msg = $exitappbuttn _ExcelBookClose($oExcel,0) Exit EndSelect WEnd *************************************************************************************************************************************************************
  6. Dear All, I have a query wherein I have a GUI in which I have a find button with a text box in Text box I type something and click on find button then what I expect to happen is the GUI to expand itslef and show the results of the search based on the search list retreived. Can anyone help me with this regards. Thanks, Vishwas
  7. Dear MVP, Am so sorry I missed it during copy paste I have taken the old script. Sorry for the inconvinence. Pl find the lates one as below. #include <Excel.au3> ;library for doing excel operations #include <GUIConstantsEx.au3> #include <Misc.au3> #include <Array.au3> #include <file.au3> Opt("GUICoordMode", 1) local $readedit,$mylist Global $currentlistselection,$hCombo ;$redvalue is the variable which accepts the 3 digit numerals for reading the row numbers from excel file Global $redvalue = String(3),$oExcelclose,$sCellValue,$oExcel,$Startappbuttn ;Checking to see if the AllStreamDetails.xls is already opened If WinExists("Microsoft Excel - AllStreamDetails.xls") Then MsgBox(0, "", "The Excel file is already open") Else ;Reading the files from Desktop ;This file should already exist on the desktop $sFilePath1 = @DesktopDir & "\AllStreamDetails.xls" ;Opening the Excel file $oExcel = _ExcelBookOpen($sFilePath1) EndIf ;Error handling in case the excel file is not existing If @error = 1 Then MsgBox(0, "Error!", "Unable to Create the Excel Object") Exit ElseIf @error = 2 Then MsgBox(0, "Error!", "File does not exist - Please copy the AllStreamDetails.xls onto your desktop and try") Exit EndIf ;Calling the GUI create function createGUI() Func createGUI() $hGUI = GUICreate("TS-Automator",350,200) GUICtrlCreateLabel("Enter the Row Number of the stream to be loaded :",10,20,250,75) Global $readedit = GUICtrlCreateInput(" ",270,15,75,20) GUICtrlCreateLabel("Select the Frequency to be set from the list:",10,50,250,75) ;Combo box with default value as 473.000 Global $hCombo = GUICtrlCreateCombo("473.000", 270, 50, 75, 20) ;Combo box with range of frequencies GUICtrlSetData(-1, "479.000|485.000|491.000|497.000|503.000|509.000|515.000|521.000|527.000|533.000|539.000|545.000|551.000|557.000|563.000|569.000|575.000|581.000|587.000|593.000|599.000|605.000|611.000|617.000|623.000|629.000|635.000|641.000|647.000|653.000|659.000|665.000|671.000|677.000|683.000|689.000|695.000|701.000|707.000|713.000|719.000|725.000|731.000|743.000|749.000|755.000|761.000|767.000", "") ; add other item snd set a new default Global $Automateappbuttn = GUICtrlCreateButton("Automate",220,120,70) GUISetOnEvent(-1,'Automate') Global $setvaluebuttn = GUICtrlCreateButton("Set Value",30,120,70,25) GUISetOnEvent(-1,"validate") Global $exitappbuttn = GUICtrlCreateButton("Exit",120,120,70) ;Making the GUI visible to the end user GUISetState() EndFunc ;This function validates the user entry of the Excel row number based on positive value calls the setvalue function Func validate() $redvalue = GUICtrlRead($readedit) If(Int($redvalue)) Then setvalue() Else MsgBox(16, "Error", "Please enter numeric values only") GUICtrlSetData($readedit,"") EndIf EndFunc Func Automate() $hGUI = GUICreate("Automate",400,500) GUICtrlCreateLabel("Enter the First Stream Path :",10,20,250,75) GUICtrlCreateLabel("Enter the Second Stream Path :",10,60,250,75) GUICtrlCreateLabel("Enter the Third Stream Path :",10,100,250,75) GUICtrlCreateLabel("Enter the Fourth Stream Path :",10,140,250,75) GUICtrlCreateLabel("Enter the Fifth Stream Path :",10,180,250,75) GUICtrlCreateLabel("Enter the Sixth Stream Path :",10,220,250,75) GUICtrlCreateLabel("Enter the Seventh Stream Path :",10,260,250,75) GUICtrlCreateLabel("Enter the Eighth Stream Path :",10,300,250,75) GUICtrlCreateLabel("Enter the Nineth Stream Path :",10,340,250,75) GUICtrlCreateLabel("Enter the Tenth Stream Path :",10,380,250,75) Global $readfirstautoedit = GUICtrlCreateInput("a ",170,20,200,20) Global $readsecondautoedit = GUICtrlCreateInput("b ",170,60,200,20) Global $readthirdautoedit = GUICtrlCreateInput("c ",170,100,200,20) Global $readfourthautoedit = GUICtrlCreateInput("d ",170,140,200,20) Global $readfifthautoedit = GUICtrlCreateInput("e ",170,180,200,20) Global $readsixthautoedit = GUICtrlCreateInput("f ",170,220,200,20) Global $readseventhautoedit = GUICtrlCreateInput("g ",170,260,200,20) Global $readeighthautoedit = GUICtrlCreateInput("h ",170,300,200,20) Global $readninethautoedit = GUICtrlCreateInput("i ",170,340,200,20) Global $readTenthautoedit = GUICtrlCreateInput("j ",170,380,200,20) ;Loop button checkbox Global $chkbox = GUICtrlCreateCheckbox("Loop", 50, 420, 120, 20) ;Creating the Start button $Startappbuttn = GUICtrlCreateButton("Start",120,450,70) ;GUISetOnEvent(-1,'Batch') ;The object refers to the already defined Exit button Global $exitappbuttn = GUICtrlCreateButton("Exit",220,450,70) GUISetState() EndFunc Func Batch() MsgBox(0, "", "The stream being played is: " & @CRLF & $readfirstautoedit, 2) EndFunc Func setvalue() ;If condition which reads the combobox to find the current selection If GUICtrlRead($hCombo) <> $currentlistselection Then ;Reads the new selection value to $hCombo variable $currentlistselection = GUICtrlRead($hCombo) ;MsgBox(0, "", "The Cell Value is: " & @CRLF & $currentlistselection, 2) EndIf ;Activates the already opened Dektec application WinActivate("DekTec StreamXpress - Transport-Stream Player") ;Moves the application to screen co-ordinates to 0,0 WinMove("DekTec StreamXpress - Transport-Stream Player", "", 0, 0) ;Delay needed to ensure the dektec in moved to the left top corner Sleep(500) ;Reading the file -> $oExcel, Reading the row number -> $redvalue,Reading the column -> 2 If IsString($sCellValue)Then $sCellValue = _ExcelReadCell($oExcel, $redvalue, 2) MsgBox(0, "", "The Cell Value is: " & @CRLF & $sCellValue, 2) ElseIf $sCellValue = "" Then MsgBox(0, "", "The Cell number selected is invalid: ") EndIf ;This commented lines reads the current stream being played by the streamer xpress app ;local $getstreamervalue ;$getstreamervalue = ControlGetText("DekTec StreamXpress - Transport-Stream Player", "", "Edit1") ;MsgBox(0, "", "The stream being played is: " & @CRLF & $getstreamervalue, 2) ;This commented lines reads the current frequency selected in the streamer xpress app ;local $getstreamerfreq ;$getstreamerfreq = ControlGetText("Streamer set Frequency is:", "", "Edit2") ;MsgBox(0, "", "The streamer frequency Value is: " & @CRLF & $getstreamerfreq, 2) local $setstream ;Button1 clicks the "open" button in Dektec app ControlClick("DekTec StreamXpress - Transport-Stream Player", "", "Button1") ;Activating the UI which appears after clicking the "open" button WinActivate("Open MPEG-2 Transport Stream") ;Delay provided to ensure the above window is launched sleep(2000) ;Setting the stream path read from "$sCellValue"(Excel file) onto the Text box(Edit1) before the Open button $setstream = ControlSetText ("Open MPEG-2 Transport Stream", " ", "Edit1", $sCellValue) ;MsgBox(0, "", "The Cell Value is: " & @CRLF & $sCellValue, 2) ;Delay provided to esnure the read stream path is copied onto the textbox(Edit1) sleep(1000) ;Pressing the Open button(Button2) to ensure the selected stream is opened in streamer application ControlClick("Open MPEG-2 Transport Stream", "", "Button2") ;MsgBox(0, "", "The stream being played is: " & @CRLF & $setstream, 2) ;WinActivate("DekTec StreamXpress - Transport-Stream Player") WinActivate("TS-Automator") local $getappfreq ;Reading the frequency from our application and storing in $getappfreq $getappfreq = ControlGetText("TS-Automator", "", "Edit2") ;~ MsgBox(0, "", "The application frequency Value is: " & @CRLF & $getappfreq, 2) local $setappfreq ;Copying the read frequency value to the streamer application(Edit6) text box $setappfreq = ControlSetText ( "DekTec StreamXpress - Transport-Stream Player", " ", "Edit6", $getappfreq) ;Ensuring the playback is stopped in streamer application ControlClick("DekTec StreamXpress - Transport-Stream Player", "", "Button21","left",2) sleep(1000) ;Ensuring the play button is pressed to start the current selected stream playback ControlClick("DekTec StreamXpress - Transport-Stream Player", "", "Button19","left",2) EndFunc While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE WinActivate("Microsoft Excel - AllStreamDetails.xls") _ExcelBookClose($oExcel,0) Exit Case $msg = $setvaluebuttn validate() Case $msg = $Automateappbuttn Automate() Case $msg = $Startappbuttn Batch() Case $msg = $exitappbuttn _ExcelBookClose($oExcel,0) Exit EndSelect WEnd
  8. Hi, I have a problem with my script when I run the below code I have a button defined as below: $Startappbuttn = GUICtrlCreateButton("Start",120,450,70 On clicking this button the function Batch should be called through the Case statement as below: Case $msg = $Startappbuttn Batch() If I comment Batch() function in the case statemtn the script does not exit if not it is exiting rapidly after launching. Pl suggest. Since I could not upload the script i am appending it with this text.Sorry for the inconvinence. Usge of the script: Run the script and click on Automate button a GUI popsup in which we have to click on the start button, but as tole it only happens if I comment teh Batch function in the case statement. Thanks, Vishwas #include <Excel.au3> ;library for doing excel operations #include <GUIConstantsEx.au3> #include <Misc.au3> #include <Array.au3> #include <file.au3> Opt("GUICoordMode", 1) local $readedit,$mylist Global $currentlistselection,$hCombo ;$redvalue is the variable which accepts the 3 digit numerals for reading the row numbers from excel file Global $redvalue = String(3),$oExcelclose,$sCellValue,$oExcel ;Checking to see if the AllStreamDetails.xls is already opened If WinExists("Microsoft Excel - AllStreamDetails.xls") Then MsgBox(0, "", "The Excel file is already open") Else ;Reading the files from Desktop ;This file should already exist on the desktop $sFilePath1 = @DesktopDir & "\AllStreamDetails.xls" ;Opening the Excel file $oExcel = _ExcelBookOpen($sFilePath1) EndIf ;Error handling in case the excel file is not existing If @error = 1 Then MsgBox(0, "Error!", "Unable to Create the Excel Object") Exit ElseIf @error = 2 Then MsgBox(0, "Error!", "File does not exist - Please copy the AllStreamDetails.xls onto your desktop and try") Exit EndIf ;Calling the GUI create function createGUI() Func createGUI() $hGUI = GUICreate("TS-Automator",350,200) GUICtrlCreateLabel("Enter the Row Number of the stream to be loaded :",10,20,250,75) Global $readedit = GUICtrlCreateInput(" ",270,15,75,20) GUICtrlCreateLabel("Select the Frequency to be set from the list:",10,50,250,75) ;Combo box with default value as 473.000 Global $hCombo = GUICtrlCreateCombo("473.000", 270, 50, 75, 20) ;Combo box with range of frequencies GUICtrlSetData(-1, "479.000|485.000|491.000|497.000|503.000|509.000|515.000|521.000|527.000|533.000|539.000|545.000|551.000|557.000|563.000|569.000|575.000|581.000|587.000|593.000|599.000|605.000|611.000|617.000|623.000|629.000|635.000|641.000|647.000|653.000|659.000|665.000|671.000|677.000|683.000|689.000|695.000|701.000|707.000|713.000|719.000|725.000|731.000|743.000|749.000|755.000|761.000|767.000", "") ; add other item snd set a new default Global $Automateappbuttn = GUICtrlCreateButton("Automate",220,120,70) GUISetOnEvent(-1,'Automate') Global $setvaluebuttn = GUICtrlCreateButton("Set Value",30,120,70,25) GUISetOnEvent(-1,"validate") Global $exitappbuttn = GUICtrlCreateButton("Exit",120,120,70) ;Making the GUI visible to the end user GUISetState() EndFunc ;This function validates the user entry of the Excel row number based on positive value calls the setvalue function Func validate() $redvalue = GUICtrlRead($readedit) If(Int($redvalue)) Then setvalue() Else MsgBox(16, "Error", "Please enter numeric values only") GUICtrlSetData($readedit,"") EndIf EndFunc Func Automate() $hGUI = GUICreate("Automate",300,150) GUICtrlCreateLabel("Enter the First Stream Path :",10,20,250,75) GUICtrlCreateLabel("Enter the Second Stream Path :",10,60,250,75) Global $readfirstautoedit = GUICtrlCreateInput(" ",170,20,100,20) Global $readsecondautoedit = GUICtrlCreateInput(" ",170,60,100,20) ;Pointing to the already defined exit function in switch case Global $exitappbuttn = GUICtrlCreateButton("Exit",120,120,70) ;~ Global $getfirstpath, $getsecondpath ;~ $getfirstpath = $readfirstautoedit ;MsgBox(0, "", "I have been called: ",$readfirstautoedit , 20000) GUISetState() sleep(2000) MsgBox(16, "Error", $readfirstautoedit) ;~ sleep(1000) EndFunc Func setvalue() ;If condition which reads the combobox to find the current selection If GUICtrlRead($hCombo) <> $currentlistselection Then ;Reads the new selection value to $hCombo variable $currentlistselection = GUICtrlRead($hCombo) ;MsgBox(0, "", "The Cell Value is: " & @CRLF & $currentlistselection, 2) EndIf ;Activates the already opened Dektec application WinActivate("DekTec StreamXpress - Transport-Stream Player") ;Moves the application to screen co-ordinates to 0,0 WinMove("DekTec StreamXpress - Transport-Stream Player", "", 0, 0) ;Delay needed to ensure the dektec in moved to the left top corner Sleep(500) ;Reading the file -> $oExcel, Reading the row number -> $redvalue,Reading the column -> 2 If IsString($sCellValue)Then $sCellValue = _ExcelReadCell($oExcel, $redvalue, 2) MsgBox(0, "", "The Cell Value is: " & @CRLF & $sCellValue, 2) ElseIf $sCellValue = "" Then MsgBox(0, "", "The Cell number selected is invalid: ") EndIf ;This commented lines reads the current stream being played by the streamer xpress app ;local $getstreamervalue ;$getstreamervalue = ControlGetText("DekTec StreamXpress - Transport-Stream Player", "", "Edit1") ;MsgBox(0, "", "The stream being played is: " & @CRLF & $getstreamervalue, 2) ;This commented lines reads the current frequency selected in the streamer xpress app ;local $getstreamerfreq ;$getstreamerfreq = ControlGetText("Streamer set Frequency is:", "", "Edit2") ;MsgBox(0, "", "The streamer frequency Value is: " & @CRLF & $getstreamerfreq, 2) local $setstream ;Button1 clicks the "open" button in Dektec app ControlClick("DekTec StreamXpress - Transport-Stream Player", "", "Button1") ;Activating the UI which appears after clicking the "open" button WinActivate("Open MPEG-2 Transport Stream") ;Delay provided to ensure the above window is launched sleep(2000) ;Setting the stream path read from "$sCellValue"(Excel file) onto the Text box(Edit1) before the Open button $setstream = ControlSetText ("Open MPEG-2 Transport Stream", " ", "Edit1", $sCellValue) ;MsgBox(0, "", "The Cell Value is: " & @CRLF & $sCellValue, 2) ;Delay provided to esnure the read stream path is copied onto the textbox(Edit1) sleep(1000) ;Pressing the Open button(Button2) to ensure the selected stream is opened in streamer application ControlClick("Open MPEG-2 Transport Stream", "", "Button2") ;MsgBox(0, "", "The stream being played is: " & @CRLF & $setstream, 2) ;WinActivate("DekTec StreamXpress - Transport-Stream Player") WinActivate("TS-Automator") local $getappfreq ;Reading the frequency from our application and storing in $getappfreq $getappfreq = ControlGetText("TS-Automator", "", "Edit2") ;~ MsgBox(0, "", "The application frequency Value is: " & @CRLF & $getappfreq, 2) local $setappfreq ;Copying the read frequency value to the streamer application(Edit6) text box $setappfreq = ControlSetText ( "DekTec StreamXpress - Transport-Stream Player", " ", "Edit6", $getappfreq) ;Ensuring the playback is stopped in streamer application ControlClick("DekTec StreamXpress - Transport-Stream Player", "", "Button21","left",2) sleep(1000) ;Ensuring the play button is pressed to start the current selected stream playback ControlClick("DekTec StreamXpress - Transport-Stream Player", "", "Button19","left",2) EndFunc While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE WinActivate("Microsoft Excel - AllStreamDetails.xls") _ExcelBookClose($oExcel,0) Exit Case $msg = $setvaluebuttn validate() Case $msg = $Automateappbuttn Automate() Case $msg = $exitappbuttn _ExcelBookClose($oExcel,0) Exit EndSelect WEnd
  9. Hi enaiman, Thanks a lot for the reply, but things are working all of a sudden I think God has pityed me :-). Thanks to both u guyz for the wonderful support offered.
  10. Hi jfcby , Thanks for the Reply. I had tried your solution even before coming to the Forum, but in vain that did not work. Can you pl tell me if you have any workaround. Thanks, Vishwas
  11. Hi All, I would like to know how to read an edit box in the excel file. I have attached the snapshot of the edit box basically am trying to read the row number displayed in the edit box but I couldn't can anyone help? Thanks, Excel Edit box reading.rar
  12. Hi, I have attached the script which opens an excel file and read the data, but the problem I have buttons added in my application and when I try to click on it.It is not allowing me to click no action at all. Note: I have uploaded the .xls file in zipped format. Just copy both the files onto you desktop and try running the script the buttons won't respond. Guidance needed pl. Thanks, Vishwas Test.au3 AllStreamDetails.rar
  13. Hi, I am trying to invoke Autoit script on clicking an hyperlink in excel and it is not happening. For Ex: In Excel I ahve an Hyperlink in a cell on clicking it based on click or no click(1/0)I want to launch an application. Am not knowing how to check through if a hyperlink in excel is clicked or not clicked. Can anyone pl help me with this regards. Thanks, Vishwas
  14. Thnx Melba that was GREAT..................:-) U made my Day.Thanks a Lot.
  15. Also i added the While(1) and Do Untill but no success :-(. I feel am not adding it at the right place in the script.Pl suggest.
×
×
  • Create New...