saio Posted May 8, 2012 Posted May 8, 2012 (edited) I need autoit to read the text that I have copied ,add it to variable and if it contains text "152t34" to do action and Repeat it Self Forever all other comands have been made but I cant do those ones... Edited May 8, 2012 by saio
water Posted May 8, 2012 Posted May 8, 2012 ClipGet? My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki
water Posted May 8, 2012 Posted May 8, 2012 Looks good. Is your problem solved now? My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki
saio Posted May 8, 2012 Author Posted May 8, 2012 Looks good. Is your problem solved now?no it get's it but I wanna make action if it finds text containing "152t34" to do action else to do another action
water Posted May 8, 2012 Posted May 8, 2012 If StringInStr($text, "152t34") > 0 Then ; Action 1 Else ; Action 2 EndIf My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki
water Posted May 8, 2012 Posted May 8, 2012 Then the string "152t34" was not found in the clipboard. My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki
saio Posted May 8, 2012 Author Posted May 8, 2012 (edited) i think I got it now how to get it to go back to my first line and repeat forever? can't find command loop.... Edited May 8, 2012 by saio
water Posted May 8, 2012 Posted May 8, 2012 Check While/WEnd. My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki
saio Posted May 8, 2012 Author Posted May 8, 2012 Ok What I do Wrong The Text is there it goes to Action 2 on the if and it stays active and does not start again... $i = 7 $lookfor = ("152t34") ShellExecute ("C:Program FilesMozilla Firefoxfirefox.exe", "MyURL.com" ) Sleep(10000) Send("{CTRLDOWN}") Send("{A down}") Send("{CTRLUP}") Send("{A UP}") Send("{CTRLDOWN}") Send("{C down}") Send("{CTRLUP}") Send("{C UP}") Local $text = ClipGet() If StringInStr($text, $lookfor) > 0 Then ProcessClose ("C:Program FilesMozilla Firefoxfirefox.exe") Else Send("{CTRLDOWN}") Send("{W down}") Send("{CTRLUP}") Send("{W UP}") EndIf Local $i = 0 While $i <= 10 wend
czardas Posted May 8, 2012 Posted May 8, 2012 (edited) Haven't tested the code. Hit Escape to quit.expandcollapse popupHotKeySet("{Esc}", "_Exit") ;$i = 7 $lookfor = ("152t34") ShellExecute ("C:Program FilesMozilla Firefoxfirefox.exe", "MyURL.com" ) Sleep(10000) While 1 Send("^a") ;Send("{CTRLDOWN}") ;Send("{A down}") ;Send("{CTRLUP}") ;Send("{A UP}") Send("^c") ;Send("{CTRLDOWN}") ;Send("{C down}") ;Send("{CTRLUP}") ;Send("{C UP}") $text = ClipGet() If StringInStr($text, $lookfor) Then ProcessClose ("C:Program FilesMozilla Firefoxfirefox.exe") ExitLoop Else Send("^w") ;Send("{CTRLDOWN}") ;Send("{W down}") ;Send("{CTRLUP}") ;Send("{W UP}") EndIf Sleep(3000) ; Repeats action every three seconds. ;Local $i = 0 ;While $i <= 10 WEnd Func _Exit() Exit EndFuncI have slowed this script right down so you can see if it is really what you want. All it does for me is close all firefox tabs. You may wish to exit the script when all Firefox tabs have closed. Look at WinExisits in the help file. Edited May 8, 2012 by czardas operator64 ArrayWorkshop
saio Posted May 8, 2012 Author Posted May 8, 2012 Haven't tested the code. Hit Escape to quit. expandcollapse popupHotKeySet("{Esc}", "_Exit") ;$i = 7 $lookfor = ("152t34") ShellExecute ("C:Program FilesMozilla Firefoxfirefox.exe", "MyURL.com" ) Sleep(10000) While 1 Send("^a") ;Send("{CTRLDOWN}") ;Send("{A down}") ;Send("{CTRLUP}") ;Send("{A UP}") Send("^c") ;Send("{CTRLDOWN}") ;Send("{C down}") ;Send("{CTRLUP}") ;Send("{C UP}") $text = ClipGet() If StringInStr($text, $lookfor) Then ProcessClose ("C:Program FilesMozilla Firefoxfirefox.exe") ExitLoop Else Send("^w") ;Send("{CTRLDOWN}") ;Send("{W down}") ;Send("{CTRLUP}") ;Send("{W UP}") EndIf Sleep(3000) ; Repeats action every three seconds. ;Local $i = 0 ;While $i <= 10 WEnd Func _Exit() Exit EndFunc I have slowed this script right down so you can see if it is really what you want. All it does for me is close all firefox tabs. You may wish to exit the script when all Firefox tabs have closed. Look at WinExisits in the help file. Nop Same Result...
czardas Posted May 8, 2012 Posted May 8, 2012 (edited) Hmm, I don't get what you mean? The result is not the same. It either closes all firefox tabs one after the other, or it closes the current tab when the text 152t34 is encountered. This was the result of fixing most of the errors I found in your code. That is probably not what you want it to do, but I'm unable to guess that part. Edited May 8, 2012 by czardas operator64 ArrayWorkshop
saio Posted May 8, 2012 Author Posted May 8, 2012 it closes the tab only and does nothing else the idea is to kill the proces firefox instantly but it does not do it....
somdcomputerguy Posted May 8, 2012 Posted May 8, 2012 If what you want to do is just see if a certain string is in a certain page, get it (the page source) with this - _INetGetSource, and process it with this - StringInStr, like in the other example. - Bruce /*somdcomputerguy */ If you change the way you look at things, the things you look at change.
czardas Posted May 8, 2012 Posted May 8, 2012 Okay I don't get it CTRL + W closes a tab in firefox. That was in the code you gave. Anyway you can test the loop is working like this. Run the code and then copy it to the clipboard again. See what happens. HotKeySet("{Esc}", "_Exit") ClipPut("") ; First empty the clipboard. $lookfor = ("152t34") $iLoopCount = 0 While 1 $text = ClipGet() If StringInStr($text, $lookfor) Then ExitLoop Else $iLoopCount += 1 EndIf Sleep(100) ; Repeats actions 10 times per second. WEnd MsgBox(0,"152t34", "Found after " & @LF & $iLoopCount & " loops") Func _Exit() Exit EndFunc operator64 ArrayWorkshop
saio Posted May 8, 2012 Author Posted May 8, 2012 (edited) 10x for the help you allso had error and I did not see it until now it's done! Edited May 8, 2012 by saio
czardas Posted May 8, 2012 Posted May 8, 2012 (edited) I have to fix errors in my code all the time. Anyway, I'm glad you got it workiing. Edited May 8, 2012 by czardas operator64 ArrayWorkshop
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now