Jump to content

Search the Community

Showing results for tags 'loop if'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • General
    • Announcements and Site News
    • Administration
  • AutoIt v3
    • AutoIt Help and Support
    • AutoIt Technical Discussion
    • AutoIt Example Scripts
  • Scripting and Development
    • Developer General Discussion
    • Language Specific Discussion
  • IT Administration
    • Operating System Deployment
    • Windows Client
    • Windows Server
    • Office

Categories

  • AutoIt Team
    • Beta
    • MVP
  • AutoIt
    • Automation
    • Databases and web connections
    • Data compression
    • Encryption and hash
    • Games
    • GUI Additions
    • Hardware
    • Information gathering
    • Internet protocol suite
    • Maths
    • Media
    • PDF
    • Security
    • Social Media and other Website API
    • Windows
  • Scripting and Development
  • IT Administration
    • Operating System Deployment
    • Windows Client
    • Windows Server
    • Office

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Member Title


Location


WWW


Interests

Found 1 result

  1. $oExcel = ObjCreate("Excel.Application") $oExcel.Visible = 0 #include <MsgBoxConstants.au3> WinActivate("MyApplication") ;Make my application active Local $hWnd = WinWaitActive("MyApplication", "", 5) ;Waits for my application to be the active application $oExcel.Application.WorkBooks.Open("C:\Users\Charlie\Desktop\Data.xlsx") ;Opens an excel file local $iCell = $oExcel.Application.Cells(31,1).Value ;Reads the number from row 1, cell 31 of the open excel file If $hWnd Then For $a = 1 to $iCell Send("G*S/") Send($oExcel.Application.Cells($a,1).Value) Send("'SET/US") Sleep(1000) Send("{ENTER}") Sleep(2000) Send("MB") Send("{ENTER}") Sleep(2000) $file = @ScriptDir & "\DATA.log" $iNum = StringRegExp(FileRead($file), "(?sm).*^\h*(\d{1,3})", 1)[0] ;I am reading the last instance of 1-3 numeric values in the DATA.log file ConsoleWrite($iNum & @CRLF) ;;;This is what I want to add - I also want to read the second last line of the DATA.log file and keep looking for an error 'Invalid Request' ;;;If I find the error 'Invalid Request' then I go back to the start - If $hWnd Then ;;;If I do not find the error then proceed to the below steps If $hWnd Then For $i = 1 To $iNum Send("GSET"& $i &"/USR") Sleep(500) Send("{ENTER}") Sleep(1000) Next Else MsgBox(0, "", '"MyApplication" window not found.') EndIf Next EndIf $oExcel.Application.Quit In the above script, I want to add a condition after 'ConsoleWrite($iNum & @CRLF)'. If I find the text 'Invalid Request' in the second last line of the active DATA.log file then I go back to the start of the loop. However if I do not find the text 'Invalid Request' in the second last line of the Data.log file then i proceed to the further steps
×
×
  • Create New...