saio 0 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 Share this post Link to post Share on other sites
water 2,366 Posted May 8, 2012 ClipGet? My UDFs and Tutorials: Spoiler UDFs:Active Directory (NEW 2020-10-10 - Version 1.5.2.1) - Download - General Help & Support - Example Scripts - WikiOutlookEX (NEW 2020-12-15 - Version 1.6.3.1) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2020-06-27 - Version 1.3.2.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsPowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & SupportExcel - Example Scripts - WikiWord - WikiTask Scheduler (2019-12-03 - Version 1.5.1.0) - Download - General Help & Support - WikiTutorials:ADO - Wiki, WebDriver - Wiki Share this post Link to post Share on other sites
saio 0 Posted May 8, 2012 ClipGet?Local $text = ClipGet() Share this post Link to post Share on other sites
water 2,366 Posted May 8, 2012 Looks good. Is your problem solved now? My UDFs and Tutorials: Spoiler UDFs:Active Directory (NEW 2020-10-10 - Version 1.5.2.1) - Download - General Help & Support - Example Scripts - WikiOutlookEX (NEW 2020-12-15 - Version 1.6.3.1) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2020-06-27 - Version 1.3.2.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsPowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & SupportExcel - Example Scripts - WikiWord - WikiTask Scheduler (2019-12-03 - Version 1.5.1.0) - Download - General Help & Support - WikiTutorials:ADO - Wiki, WebDriver - Wiki Share this post Link to post Share on other sites
saio 0 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 Share this post Link to post Share on other sites
water 2,366 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 2020-10-10 - Version 1.5.2.1) - Download - General Help & Support - Example Scripts - WikiOutlookEX (NEW 2020-12-15 - Version 1.6.3.1) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2020-06-27 - Version 1.3.2.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsPowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & SupportExcel - Example Scripts - WikiWord - WikiTask Scheduler (2019-12-03 - Version 1.5.1.0) - Download - General Help & Support - WikiTutorials:ADO - Wiki, WebDriver - Wiki Share this post Link to post Share on other sites
saio 0 Posted May 8, 2012 yea now check works but it alays go to Action 2 Share this post Link to post Share on other sites
water 2,366 Posted May 8, 2012 Then the string "152t34" was not found in the clipboard. My UDFs and Tutorials: Spoiler UDFs:Active Directory (NEW 2020-10-10 - Version 1.5.2.1) - Download - General Help & Support - Example Scripts - WikiOutlookEX (NEW 2020-12-15 - Version 1.6.3.1) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2020-06-27 - Version 1.3.2.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsPowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & SupportExcel - Example Scripts - WikiWord - WikiTask Scheduler (2019-12-03 - Version 1.5.1.0) - Download - General Help & Support - WikiTutorials:ADO - Wiki, WebDriver - Wiki Share this post Link to post Share on other sites
saio 0 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 Share this post Link to post Share on other sites
water 2,366 Posted May 8, 2012 Check While/WEnd. My UDFs and Tutorials: Spoiler UDFs:Active Directory (NEW 2020-10-10 - Version 1.5.2.1) - Download - General Help & Support - Example Scripts - WikiOutlookEX (NEW 2020-12-15 - Version 1.6.3.1) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2020-06-27 - Version 1.3.2.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsPowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & SupportExcel - Example Scripts - WikiWord - WikiTask Scheduler (2019-12-03 - Version 1.5.1.0) - Download - General Help & Support - WikiTutorials:ADO - Wiki, WebDriver - Wiki Share this post Link to post Share on other sites
saio 0 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 Share this post Link to post Share on other sites
czardas 1,269 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 Share this post Link to post Share on other sites
saio 0 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... Share this post Link to post Share on other sites
czardas 1,269 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 Share this post Link to post Share on other sites
saio 0 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.... Share this post Link to post Share on other sites
somdcomputerguy 103 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. Share this post Link to post Share on other sites
czardas 1,269 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 Share this post Link to post Share on other sites
saio 0 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 Share this post Link to post Share on other sites
czardas 1,269 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 Share this post Link to post Share on other sites