Jump to content

Search the Community

Showing results for tags 'search'.



More search options

  • 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

Categories

  • Forum
  • AutoIt

Calendars

  • Community Calendar

Found 50 results

  1. My program has to first search for names in Column D that do not match up with column C. I got that search to work using arrays. It was slow and I could not figure out how to delete them so I just manually put coded the names that do not belong. I found their cell location but I do not know how to store that location and delete it. This is what I have so far. Local $NameToDelete1[6]  = _Excel_RangeFind($OpenWorkbook, "Smith, Bill") _ArrayDisplay($NameToDelete1, "Excel UDF: _Excel_RangeFind Example 1", "", 0, "|", "Sheet|Name|Cell|Value|Formula|Comment") _Excel_RangeDelete($OpenWorkbook.ActiveSheet, $NameToDelete1[2], $xlShiftUp) Please help, I wanted to have this program done yesterday but I did not see this problem until yesterday.
  2. I'm trying to implement a Ctl-F popup box that looks something like the one that Notepad uses, but I'm not havine much luck. I intend to get it working, then beef up the popup's contents to add several checkboxes, buttons and radio boxes. What my example code does is to use InputBox(), but that's not what I want. Here is my test code: #include <Array.au3> #include <GUIConstantsEx.au3> #AutoIt3Wrapper_Au3Check_Parameters=-d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6 Opt("GUICloseOnESC", 1) Opt("GUIOnEventMode", 1) Opt('MustDeclareVars', 1) OnAutoItExitRegister("ExitStageLeft") Opt("WinTitleMatchMode", -2) Global $hGUI _Main() Func _Main() $hGUI = GUICreate("Test ^F", 300, 200) setupSpecialKeysHandlers() GUISetOnEvent($GUI_EVENT_CLOSE, "Event_GUIClose") GUISetState() While (1) Sleep(157) WEnd EndFunc ;==>_Main Func handle_CTRL_F_key() Local $str $str = InputBox("Search", "Enter the string to search for:") ConsoleWrite("+++: $str ==>" & $str & "<==" & @CRLF) EndFunc ;==>handle_CTRL_F_key Func ExitStageLeft() Exit (99) EndFunc ;==>ExitStageLeft Func Event_GUIClose() Exit (1) EndFunc ;==>Event_GUIClose Func setupSpecialKeysHandlers() Local $ar, $parts, $key, $handler, $id Local $aAccelKeys[1][2] ; Create a table of Special keys and their handlers $ar = StringSplit("", "") _ArrayAdd($ar, "^f - handle_CTRL_F_key ") ReDim $aAccelKeys[UBound($ar) - 1][2] ; Now, create $aAccelKeys array with the table data. ; For each entry, create a Dummy GUI and associate its ; ID with the special key. For $ndx = 1 To UBound($ar) - 1 $parts = StringSplit($ar[$ndx], "-", 2) $key = StringStripWS($parts[0], 8) $handler = StringStripWS($parts[1], 8) $id = GUICtrlCreateDummy() $aAccelKeys[$ndx - 1][0] = $key $aAccelKeys[$ndx - 1][1] = $id GUICtrlSetOnEvent($id, $handler) Next GUISetAccelerators($aAccelKeys) ; Setup the Special keys hooks EndFunc ;==>setupSpecialKeysHandlers
  3. Howdy, I've gone through a lot of au3 forums, and I once had a working Imagesearch script that I got from here. However, and i'm just totally not sure how but my imagesearch scripts aren't working anymore. I'm not new to au3 but i'm not the most experienced with it's syntax/commands. Anyways, I've looked over the big threads involving imagesearch. Does anyone have a working Imagesearch x64 for win10 that is currently working as of the date with the post. Dll's and what not is fine, just when I tell the script to run, I want to be able to find the image on the screen! Can't find a working copy so if anyone has one please send it my way lol. I've taken all the imagesearch downloads and what not and have played with them but I can't get any of them working on my end, despite others saying they're working. Thanks.
  4. HELLO GUYS I'm a work on a background see and click bot project I can complete it if your help me (using imagesearch , gdi+ and fastfind)
  5. Perform a simple google search! The script below works fine until fill the google form! What I can't find is how to submit the form, tried a couple of ways and none of them worked. #include <IE.au3> $oIE = _IECreate ("www.google.com") $o_form = _IEFormGetObjByName ($oIE, "f") $o_login = _IEFormElementGetObjByName ($o_form, "q") $username = "80251369" _IEFormElementSetValue ($o_login, $username) $o_numer = _IEGetObjByName($o_form, "btnK") _IEAction ($o_numer, "click") The code runs without any problem. I don't know how to proceed! Thanks in advance!
  6. Hi dears how are you? I hope You fine I have a question please I've created a listView It has several columns Is there any way to search for text in an element of this list with text in all columns for example list view with 2 column the first is the file name and the second is the file path and i want to search for the item witch Containt the name and the path toGether I searched a lot but could not find what I was looking for If you do not understand the idea that I'm looking for, I can put an example Thanks in advance
  7. Hello everyone, I'm working on a task where, a PDF file is opened (in IE browser) when I click a link in a website. I have to read the first page of the PDF to find particular strings. Can you please share some ideas?
  8. If possible please add or edit the comments to explain how this works. ;includes functions from other things #include <GDIPlus.au3> #include <ScreenCapture.au3> ;hotkeys HotKeySet("{ESC}", _exit) HotKeySet("{F1}", _scan) ;global variables Global $win_title ;name of the window Global $area_x ; Global $area_y ; Global $area_w ; Global $area_h ; Global $cursor ; Global $rect_file ; Global $hbmpscreen ; Global $i= 1043 ;moves the rect Global $ii= 378 ;moves the rect Global $x=1044 ;inner rect offset Global $y=501 ;inner rect offset Global $hbmprect ;image inside rect Global $hscreen ;image whole screen _GDIPlus_Startup() ;? ;display hotkeys on screen ToolTip("Press F1 to scan | Press ESC to Exit",0,0) ;infinite loop to keep prog running While 1 Sleep(100) WEnd Func _scan() ;~ reads your screen area: _read() ;~ converts screen captured into bmp _convert() ;~ . Loads converted bmp to be read _loadBMP() ;~ compares the bmp of your scanned screen to the actual screen that is being displayed _compare() EndFunc ;reads screen Func _read() $hscreen = _ScreenCapture_CaptureWnd("", WinGetHandle($win_title), $area_x, $area_y, $area_x + $area_w, $area_y + $area_h, $cursor) EndFunc ;converts screen into bmp Func _convert() _GDIPlus_BitmapCreateFromHBITMAP($hscreen) EndFunc ;loads converted screen Func _loadBMP() _GDIPlus_BitmapCreateFromFile($rect_file) EndFunc ;compares savedBMP to current screen Func _compare() ;If( below code ) = ( below code ) Then If _GDIPlus_BitmapGetPixel($hbmpscreen, ($i + $x) - $area_x, ($ii + $y) - $area_y) = _GDIPlus_BitmapGetPixel($hbmprect, $x, $y) Then ;display message box titled found with a message of found MsgBox("","","found") ;if above is not correct then EndIf EndFunc ;exit func Func _exit() Exit EndFunc
  9. Hello everybody, so I might found a bug in _ArraySearch: #include <Array.au3> Local $abc[2] = ["b", "b"] $h = "+---------------------------------+" & @CRLF ConsoleWrite($h) For $i = 0 To 1 $abc[0] = 0 out() $abc[0] = 1 out() $abc[0] = -1 out() $abc[0] = "Abc" out() $abc[1] = "Hello" Next Func txt() Return "$abc = [" & $abc[0] & ", " & $abc[1] & "]" & @CRLF & _ "> _ArraySearch($abc,""Hello"") = " EndFunc ;==>txt Func shouldoutput($ans) Return "_ArraySearch Should return: " & ($ans ? 1 : -1) EndFunc ;==>shouldoutput Func out() ConsoleWrite("> " & txt() & _ArraySearch($abc, "Hello") & @CRLF & "> " & shouldoutput($abc[1] == "Hello") & @CRLF & $h) EndFunc ;==>out Exit Sorry for this messy script
  10. Autoit _3DModelSearch

    Hi Autoit Community, do someone know, if is possible to creat an 3D-ModelSearch script ?
  11. I would like to download the first 5 images in a folder. THX. #include <INet.au3> #include <String.au3> #include <Array.au3> Global $sSource, $aImgURL, $sKeyWord $sKeyWord = "pug" $sSource = _INetGetSource("http://www.google.com/search?q=" & $sKeyWord & "&tbm=isch") $aImgURL = _StringBetween($sSource, 'src="', '"') For $x = 1 to UBound($aImgURL)-1 ConsoleWrite($aImgURL[$x]&@CRLF) Next
  12. Hello, Im a new AutoIt user, im from Spain and i would like to share here my own image search detection method. What's about it? It's not perfect, but with it you don't need to use any DLL file. You don't need to distribute the image file with your final AU3 Script, or Exe if compiled. The image size does not affect to the detection speed. It's bug free (i believe). You can find here as an attach file, a distro package with all you need, and it includes a simple how-to guide. Im going to paste here the how-to guide: How to use this AutoIt image detector: Point 1: Install JRE (Java Runtime Environment), without this you can't execute Java Applications (.jar files). Open the Java tool named AISD with double click on it, or "java -jar aisd.jar" in the cmd. In AISD, open the image you want to detect in your script. Remember: the upper left pixel of the image, MUST be a not common color in the background if you want a fast detection. Then you will get a script file if you want, or only a clipboard copied version, full ready to paste into your main script because this one comes with extra help codes. Anyway, the generated code is the $sign definition of the image (calm down, point 3 explains what is the $sign and it's easy). Point 2: Paste the mentioned code in your main script, and try to follow the sample_usage script. If you know how to write au3 codes, it should be very easy. In general terms, all you need is to include image_search.au3, and then you can use the func image_search($sign, $width, $height). You need also the get_image_sign() function, that calculates the first parameter for image_search(). The get_image_sign() function is the one you have generated at point 1. Point 3: image_search() returns the center point of the target image. The func needs the $sign from the image, width and height. This $sign is the "footprint" of the image, in the form of an array of 9 integers. In most of the cases the $sign should be enough to identify the image, this is useful because using the $sign instead of the real image let you get a small script and a fast detection. You can also delete the image once you get the $sign. This $sign has always the same size (those 9 integers, it does not matter if the original image is small or big). How can you define the $sign for a certain image?, you don't need to generate the $sign, AISD does (point 1). Follow the sample_usage script and you will get it. Files in this distro package: * AISD.jar: The already explained Java app. * image_search.au3: The library or module with the resources that lets you detect images. * sample_usage.au3: The mentioned sample_usage script. It contains the smallest example, but i think it should be ok for learning purposes. * sample_usage.exe: The sample_usage.au3 script compiled (au3 -> .exe). You can execute this to see the image_search() func working. * sample_target.png: The image to be detected in the sample_usage. You can delete this file and the script will be fine. * OffsetCalc.jar: It's only a Java tool to calculate the offset to transform an XY point into another one. It's useful if you want to use apply_offset function (from image_search.au3). Both things are only necessary when it's hard to find a version of the target image with upper left pixel in the way mentioned. As you can imagine, the idea is to detect another image and then apply the offset to get the real coordinates of the original target image. Happy Detections Lasker image_search.zip
  13. Hello, I am using the addon-library of FastFind.au3 found here : The script I've put together is rather simple but it's returning a value that I don't understand. #include "FastFind.au3" #Include <WinAPI.au3> #RequireAdmin WinActivate ("ABC Window") Local $xyzWindow = WinGetHandle ("ABC Window") Local $triangleSpot = FFSnapShot (212, 216, 214, 218, 1, $xyzWindow) ConsoleWrite ($triangleSpot&@CR) Local $triangleData = FFGetRawData (1) Local $splitTriangleData = StringSplit ($triangleData, "00") Local $iMax If isArray ($splitTriangleData) Then $iMax = Ubound ($splitTriangleData) ConsoleWrite ($iMax) EndIf So here's the question... If the area I have selected is a total of 4 pixels , why is the UBound return value 26? I thought that maybe it was getting values for the 4 along with the surrounding pixels bordering the selected area, even still , it should provide only 16 values(or so I thought). I feel that there is a bit of pixel data or something that I am not fully understanding. If anyone could please provide materials on what is happening I'd really appreciate it. Thank you for your time! -Reiz PS : I used terms like "triangleSpot" and such because in the actual window there is a small triangle icon that I am trying to gain the pixel data of to then search for others like it on the page. I understand the area that I am selecting is a square/rectangle and not a triangle.
  14. hello everyOne how can i get Google search suggestions while typing text and save it to txt file
  15. I love Autoit, but struggling to find the best way to do this. I have 2 text files.... File1 is Tab Separated and File2 is CSV. I am attempting to read in a line from File1 and split it, then search the contents of File2 for one of the substrings from that split line. If I find a match, then I want to split the matching line and grab needed info from it to complete the record and output the combined record to a file. Example line from File1: 17 123456789 learned 10800 bridging 1/13 Example line from File2: 172.25.17.103,computername.domain,Reservation (active),DHCP,123456789,,Full Access,N/A From File1, I grab the 2nd column (MAC Address) and search for that in the 2nd file (Column5) I really thought reading file into an array and doing an _arraysearch was the way to go, but that seems to require searching for the whole string, not a sub-string. What I have been trying to do so far is read in file1 one line at a time, split the string, then read in file 2 one line at a time and check for a matching substring..... handle that. Then back to file 1 to repeat the process. This seems so clunky. So I would love suggestions on what functions might work best. Thanks so much for any feedback. - John
  16. I have created an app that allows me to save server names as field values and other information associated with their nodes. (example below) <Servers> <ServerInfo> <Server_Name>MyServerName</Server_Name> <User>user_name</User> <Password>0x8534C1E508D4CF29AC17</Password> </ServerInfo> </Servers I am trying to use "_XMLNodeExists" from "_XMLDOMWrapper.au3" to search for existing server entries by field value. (Sorry if my XML terms are not quite right) I didn't quite follow how to search and I am not sure if this function can perform how I expect it to... My attempt _XMLNodeExists('//Servers/ServerInfo/Server_Name/MyServerName')Any suggestions how I might go about searching my XML file? I had thought of just searching as plain text.
  17. So I tried to get the first file of a folder with FileFindFirstFile but it always gives me a 1 as a value, so it tells me that the folder is empty. But the folder is not empty. Code: Local $path_times_text_01 = "D:\xxx\test\xxx\" Local $search = FileFindFirstFile($path_times_text_01 & "*.*") Timecheck() Func Timecheck() ConsoleWrite($search & @CRLF) If $search = -1 Then MsgBox(0, "Error", "could not find extension") Exit EndIf If $search = 1 Then MsgBox(0, "Fehler", "folder is empty") Exit EndIf ConsoleWrite($search & @CRLF) EndFuncThis does not make any sense to make because again the folders are not empty.
  18. Hello, Sorry to bother you ... but .. I have a problem im pretty sure its something you can figure out in least than 5second, but for a reason I just cant get.... I dont. Look its pretty simple. the script does as follow : search for different folder and subdirectories for NSF files. once found, it log it and copy to to a $storage of my choice . the problem is the following, theres is a "IF" if a file with the same name is found, it add _1 to the end of the filename... unfortunately for a reason i just dont get... I cant get it to work if I use anything else than : $Filename = @UserName & $suffixe & ".nsf"" I tried $aFiles $aNSFFiles etc.. nothing work. but @username does the increement.. ( around line 38 ) thank you ...
  19. Hi gang, I'm in a bit of a pickle here, the gist of it is that i have one "main" file with ~200k lines, and literally hundreds of other files each ranging from 1k - 100k lines. I need to go through each of the "other" files and (separately) compare them to the "main" file, and save the differences between the two (no duplicates) The issue is that each comparison (especially if the "other" file has 50+ k lines) takes over a minute each... Is there anyway to cut this time down? As far as i know im using the most optimized array difference script Here's a rough mockup of the script im currently using note: the main file has all unique lines, and the "other" files wont ever have any lines that *DO NOT* appear in the main file, if that helps #include <array.au3> #include <file.au3> global $info_file global $compare_file global $Differece $info_file = FileReadToArray("info-file(200k lines).txt") $compare_file = FileReadToArray("compare-file(100k lines).txt") $Differece = _Diff($info_file, $compare_file, 0) ; get the difference between 2 arrays, NO duplicates _ArrayDisplay($Differece) ;================================================= ; Function Name: _Diff($Set1, $Set2 [, $GetAll=0 [, $Delim=Default]]) ; Description:: Find values in $Set1 that do not occur in $Set2 ; Parameter(s): $Set1 set 1 (1D-array or delimited string) ; $Set2 set 2 (1D-array or delimited string) ; optional: $GetAll 0 - only one occurence of every difference are shown (Default) ; 1 - all differences are shown, allowing duplicates ; optional: $Delim Delimiter for strings (Default use the separator character set by Opt("GUIDataSeparatorChar") ) ; Return Value(s): Succes 1D-array of values from $Set1 that do not occur in $Set2 ; Failure -1 @error set, that was given as array, isn't 1D-array ; Note: Comparison is case-sensitive! - i.e. Number 9 is different to string '9'! ; Author(s): BugFix (bugfix@autoit.de) Modified by ParoXsitiC for Faster _Diff (Formally _GetIntersection) ;================================================= Func _Diff(ByRef $Set1, ByRef $Set2, $GetAll = 0, $Delim = Default) Local $o1 = ObjCreate("System.Collections.ArrayList") Local $o2 = ObjCreate("System.Collections.ArrayList") Local $oDiff1 = ObjCreate("System.Collections.ArrayList") Local $tmp, $i If $GetAll <> 1 Then $GetAll = 0 If $Delim = Default Then $Delim = Opt("GUIDataSeparatorChar") If Not IsArray($Set1) Then If Not StringInStr($Set1, $Delim) Then $o1.Add($Set1) Else $tmp = StringSplit($Set1, $Delim, 1) For $i = 1 To UBound($tmp) - 1 $o1.Add($tmp[$i]) Next EndIf Else If UBound($Set1, 0) > 1 Then Return SetError(1, 0, -1) For $i = 0 To UBound($Set1) - 1 $o1.Add($Set1[$i]) Next EndIf If Not IsArray($Set2) Then If Not StringInStr($Set2, $Delim) Then $o2.Add($Set2) Else $tmp = StringSplit($Set2, $Delim, 1) For $i = 1 To UBound($tmp) - 1 $o2.Add($tmp[$i]) Next EndIf Else If UBound($Set2, 0) > 1 Then Return SetError(1, 0, -1) For $i = 0 To UBound($Set2) - 1 $o2.Add($Set2[$i]) Next EndIf For $tmp In $o1 If Not $o2.Contains($tmp) And ($GetAll Or Not $oDiff1.Contains($tmp)) Then $oDiff1.Add($tmp) Next If $oDiff1.Count <= 0 Then Return 0 Local $aOut[$oDiff1.Count] $i = 0 For $tmp In $oDiff1 $aOut[$i] = $tmp $i += 1 Next Return $aOut EndFunc ;==>_Diff
  20. StringFinder

    Version 1.2.3

    560 downloads

    StringFinder - Find String in Files.
  21. StringFinder v1.2.3

    I hate the Microsoft Windows search. After trying the powerfull "Agent Ransack", i said to myself ; why not create a free alternative in AutoIt ? StringFinder replace my old TinyAu3FilesSearch utility and will be added to the next version of SciTE Hopper Unlike to TinyAu3FileSearch, you can search strings in any "Text" files. Source and compiled Version are available in the Download Section. Enjoy !
  22. Hi Guys, I am writing an app that involves a list view with for example 100 rows. I have added an input box and search button to search the list view for whatever was in the input box. I found this function on the forum: Button2() Func Button2() ;MsgBox(0, "Button2", GUICtrlRead($Input)) $value = GUICtrlRead($Input) ; Search for target item $iI = _GUICtrlListView_FindInText($ListView1, $value, -1) _GUICtrlListView_EnsureVisible($ListView1, $iI) EndFunc This works to a degree but only jumps to a matching string and not in every case even though the string is definitely in the list view. What i want to do is redraw the listview with any results matching or part matching the string in the input box. Im sure someone will of already done this if so could i see the code as i do not know where to begin. Thanks, Dan
  23. When I search something then the results are not up-to-date. E.g. if you search for "UEZ", sorted by Last Update Time, then the first result is from 23. Feb. 2015. Seems that the indexing or something else not working properly.
  24. Search and search IN file

    Here my srcipt for searching files and/or searching inside files. Made long time ago with the help of this forum. #include <File.au3> #include <Array.au3> #include <ButtonConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <ProgressConstants.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #include <MsgBoxConstants.au3> Global $sRet[1] = ["0"], $flag, $percent Local $j, $aArayFound[1], $a = 0, $b = 0, $sFolder = "", $debug = 0 ;~ _ArrayDisplay( $sRet , "$sRet") #Region ### START Koda GUI section ### Form= $Gui = GUICreate("Search Engine", 554, 559, -1, -1) If $debug Then $iFolder = GUICtrlCreateInput("C:\Users\Admin\au3", 160, 10, 121, 21, $ES_READONLY) $iFilter = GUICtrlCreateInput("*.au3", 160, 40, 121, 21) $iWord = GUICtrlCreateInput("gui", 160, 70, 121, 21) Else $iFolder = GUICtrlCreateInput("Folder to search in", 160, 10, 121, 21, $ES_READONLY) $iFilter = GUICtrlCreateInput("filter *.*", 160, 40, 121, 21) $iWord = GUICtrlCreateInput("word inside file", 160, 70, 121, 21) EndIf $bSearch = GUICtrlCreateButton("Search", 290, 40, 91, 50, $BS_DEFPUSHBUTTON) $bChoose = GUICtrlCreateButton("Choose Folder", 290, 10, 91, 21) $lLabel = GUICtrlCreateLabel("", 6, 130, 541, 70) $pProgress = GUICtrlCreateProgress(160, 100, 217, 25) $eEdit = GUICtrlCreateEdit("", 3, 201, 548, 354) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### GUICtrlSetLimit($eEdit, 2147000000) ;~ GUICtrlSetData( $iFolder, "C:\") ;~ GUICtrlSetData( $iFilter, "*.aif") ;~ GUICtrlSetData( $iWord, "") ;http://www.autoitscript.com/forum/topic/126552-solved-guictrlcreateinput-question/ While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $bChoose $sPath = FileSelectFolder("Choose Folder", "", 0, "", GUICreate("")) ;~ $sPath=FileOpenDialog ( "Choose", "::{20D04FE0-3AEA-1069-A2D8-08002B30309D}", "All (*.*)" , 7 , "", GUICreate("") ) GUICtrlSetData($iFolder, $sPath) Case $GUI_EVENT_PRIMARYDOWN $aCInfo = GUIGetCursorInfo($Gui) If $aCInfo[4] = $iFilter And $a = 0 Then GUICtrlSetData($iFilter, "") $a = 1 EndIf If $aCInfo[4] = $iWord And $b = 0 Then GUICtrlSetData($iWord, "") $b = 1 EndIf Case $bSearch $flag = 0 $f = 1 If Not (StringInStr(GUICtrlRead($iFolder), ":\")) Then $MsgBox = MsgBox(5 + 16, "Error", "The input folder is not correct:" & @CRLF & "Retry = Choose an another Folder" & @CRLF & "Cancel = Exit") If $MsgBox <> 4 Then Exit Else $f = 0 EndIf EndIf If StringInStr(GUICtrlRead($iFilter), "Filter") And $f = 1 Then $MsgBox = MsgBox(5 + 16, "Error", "The input filter is not correct:" & @CRLF & "Retry = Choose an another Filter" & @CRLF & "Cancel = Exit") If $MsgBox <> 4 Then Exit Else $f = 0 EndIf EndIf If StringInStr(GUICtrlRead($iWord), "word inside file") Then GUICtrlSetData($iWord, "") EndIf If StringRight(GUICtrlRead($iFolder), 1) = "\" Then $sFolder = StringTrimRight(GUICtrlRead($iFolder), 1) Else $sFolder = GUICtrlRead($iFolder) EndIf If $f Then GUICtrlSetData($eEdit, "Please wait...") _Search(GUICtrlRead($iWord), GUICtrlRead($iFilter), $sFolder) EndIf EndSwitch WEnd Func _Search($sSearchString, $sFindFile, $sPath) ;~ ConsoleWrite($sSearchString&"--"&$sFindFile&"--"&$sPath & @LF) Dim $aRetArray[1], $aArayFound[1] Global $sRet[1] = ["0"] $j = 0 $aRetArray = _FindPathName($sPath, $sFindFile, $sSearchString) If $aRetArray[0] = "0" Then ;~ ReDim $aRetArray[2] ;~ $aRetArray[0] = 1 ;~ $aRetArray[1] = "File not found" $sEdit = "File not found" EndIf _UpdateBar(2) If $sSearchString <> "" Then For $i = 1 To $aRetArray[0] $file = FileOpen($aRetArray[$i], 0) _UpdateBar(0, $i, $aRetArray[0]) If $file = -1 Then Else $text = FileRead($file) If StringInStr($text, $sSearchString) > 0 Then $j += 1 ReDim $aArayFound[$j + 1] $aArayFound[$j] = $aRetArray[$i] If $j=1 Then GUICtrlSetData($eEdit, "") GUICtrlSetData($eEdit, $aArayFound[$j] & @CRLF,1) EndIf EndIf FileClose($file) Next ;~ _ArrayDisplay($aArayFound, "List of file with the String: "&$sSearchString&" found") If (Not $j) Then $sEdit = "File not found" GUICtrlSetData($eEdit, $sEdit) ;~ Else ;~ $sEdit = "" ;~ For $i = 1 To UBound($aArayFound) - 1 ;~ $sEdit &= $aArayFound[$i] & @CRLF ;~ Next EndIf ;~ GUICtrlSetData($eEdit, $sEdit) _UpdateBar(2) Else ;~ _ArrayDisplay($aRetArray,"List of folders found") ;~ $sEdit = "" ;~ For $i = 1 To UBound($aRetArray)-1 ;~ $sEdit &= $aRetArray[$i] & @CRLF ;~ Next ;~ GUICtrlSetData($eEdit, $sEdit) EndIf EndFunc ;==>_Search ;~ http://www.autoitscript.com/forum/topic/95160-file-searcher ;~ In this forum All files where not Found... ;~ So here is the new way of doing it (Made By Cramaboule) ; Searches all subfolders of $sPath for $sFindFile (* and ? wildcards accepted) ; Returns an array containing full path and name of all matches. ; Number of matches is in zero index of array Func _FindPathName($sPath, $sFindFile, $sSearchInFile) Local $sSubFolderPath, $iIndex, $aFolders GUICtrlSetData($lLabel, $sPath) _UpdateBar(1) $aFolders = _FileListToArray($sPath, "*", 2) $error = @error $aFile = _FileListToArray($sPath, $sFindFile, 1) If Not (@error) Then ; no files For $k = 1 To $aFile[0] _ArrayAdd($sRet, $sPath & "\" & $aFile[$k]) If $sSearchInFile = "" Then $flag += 1 If $flag = 1 Then GUICtrlSetData($eEdit, $sPath & "\" & $aFile[$k] & @CRLF); efface uniquement la première fois ! ;~ ConsoleWrite($sPath& "\"&$aFile[$k]& @CRLF) EndIf GUICtrlSetData($eEdit, $sPath & "\" & $aFile[$k] & @CRLF, 1) ;~ ConsoleWrite($sPath& "\"&$aFile[$k]& @CRLF) EndIf Next $sRet[0] = UBound($sRet) - 1 EndIf If Not ($error) Then ; no folders For $i = 1 To $aFolders[0] $sSubFolderPath = $sPath & "\" & $aFolders[$i] _FindPathName($sSubFolderPath, $sFindFile, $sSearchInFile) Next EndIf Return $sRet EndFunc ;==>_FindPathName Func _UpdateBar($Update = 0, $actuel = 0, $total = 0) If $Update = 1 Then $percent += 1 If $percent >= 100 Then $percent = 0 EndIf ElseIf $Update = 0 Then $percent = Ceiling(($actuel / $total) * 100) GUICtrlSetData($pProgress, $percent) ElseIf $Update = 2 Then $percent = 100 EndIf ;~ ConsoleWrite($percent & " " & $actuel & " " & $total & @CRLF) GUICtrlSetData($pProgress, $percent) EndFunc ;==>_UpdateBar Enjoy. C.
  25. Hi all Im still New To Autoit and would realy like some help ... I have gone through some examples and other code on the forum but now I am stuck see comments on what I want to do . #RequireAdmin #include <IE.au3> #include <MsgBoxConstants.au3> #include <File.au3> #include <String.au3> #include <Array.au3> Global $oIE = _IECreate("https://www.harryhomers.org/et/forum/viewtopic.php?f=89&t=4309", 0, 0, 1, 0) Global $oElements = _IETagNameAllGetCollection($oIE) Global $oID = _IEGetObjById($oIE, "p41827") Global $ListArray[1] #cs ; the list I want to get is 1 - 20 max 30 and there names . The DIV ID is p41827 <div class="content">HarryHomers can be found at 85.236.100.205:<span style="font-weight: bold">27960</span><br /><br /><ul>HH Bot Multi campaign **<br /><br />1. NAME 1<br />2. NAME 2<br />3. NAME 3<br />4. NAME 4<br /> 5. NAME 5<br />6. NAME 6<br />7. NAME 7<br />8. NAME 8<br />9. NAME 9<br />10. NAME 10<br />11. NAME 11<br />12. NAME 12<br />13. NAME 13<br />14. NAME 14<br /> 15. NAME 15<br />16. NAME 16<br />17. NAME 17<br />18. NAME 18<br />19. NAME 19<br />20. NAME 20<br /> </ul> #ce For $oElement in $oElements Local $_sSourceTAG = $oElement.tagname Local $_sSourceTEXT = $oElement.innerText Local $_sSourceID = $oElement.id Local $_sSourceHTML = $oElement.innerhtml If $_sSourceID = "p41827" Then ;Test message box MsgBox($MB_SYSTEMMODAL, "MY TAG ID", "Innertext: " & $_sSourceTAG & @CRLF & "id: " & $_sSourceID & @CRLF & "innerText: " & $_sSourceTEXT) MsgBox($MB_SYSTEMMODAL, "MY HTML", "Innerhtml: " & "id: " & $_sSourceID & $_sSourceHTML) $oData = _IEPropertyGet($oIE, "strong") $Check = StringRight($oData, 11) If $Check = "ohnDory</A>" Then ;Test message box MsgBox($MB_SYSTEMMODAL, "SEARCH FOUND", "The characters are: " & $Check ) $ArraySplit1 = StringSplit($oData, ".") For $ArrayItem in $ArraySplit1 $ArrayItem = StringSplit($ArrayItem, "<BR>", 1) If $ArrayItem[0] > 1 Then If $ArrayItem[2] > 0 Then $ArrayItem[1] = StringStripWS($ArrayItem[1], 3) _ArrayAdd($ListArray, $ArrayItem[1]) EndIf EndIf If StringInStr($ArrayItem[1], "</UL>") Then $POS = StringInStr($ArrayItem[1], "</UL>") - 1 $String = StringLeft($ArrayItem[1], $POS) $String = StringStripWS($String, 3) _ArrayAdd($ListArray, $String) EndIf Next Else ; Not correct so ignore MsgBox($MB_SYSTEMMODAL, "NOT FOUND", "The characters are: " & $Check ) EndIf EndIf Next _ArrayDisplay($ListArray) _ArrayReverse($ListArray) _ArrayPop($ListArray) _ArrayReverse($ListArray) _ArrayDisplay($ListArray, "Map List Array Final View") sleep(2500) _IEQuit($oIE) #cs ; note the html (map names) does change once a month ; save txt file #ce ;_FileWriteLog(@TempDir & "\list.txt", $ListArray)
×