All Activity

This stream auto-updates   

  1. Past hour
  2. @rkr, Try this and try playing with it. #include <File.au3> Dim $array $file = @ScriptDir & "\gaplst." $find = InputBox('Line Search', 'Type in below what to search for.' & @CRLF & _ 'Lines that match will be showned.', 'Text To Match', '', 200, 140) $found = 0 $lines = '' If $file <> '' And $find <> '' Then _FileReadToArray($file, $array) For $i = 1 To UBound($array) - 1 If StringInStr($array[$i], $find) Then $array[$i] = '' $found += 1 $lines &= $i & ', ' EndIf Next MsgBox(64, 'Done', 'Total lines found = ' & $found & @CRLF & _ 'Searched Line(s)= ' & FileReadLine($file, $lines)) Else MsgBox(48, 'Error', 'A file was not picked or what to find was cancelled/empty!') EndIf
  3. yeah! just like your answer!
  4. Problem solved, thanks for help =)
  5. You need to ask yourself which event you are trying to trigger. If the goal is to trigger the onClick event, then use _IEAction with click. In this case, the code is in the onFocus event, so you need to give the element focus for that event to be triggered.
  6. Today
  7. You could check the value of @extended after the call to _IETagNameGetCollection. It should contain the number of matching elements.
  8. I dont know man. To me, click=click. Pretty sure in Africa click also means click with a mouse.
  9. Interesting approach, delaney! But right off the start, I hit a problem. If I just start Chrome then do: WinList("[CLASS:Chrome_WidgetWin_1]") I get two items in the array. One has the title of the main window, the other has a blank title (which is what my target popup also has). When the popup appears, I DO get another item in the winlist array but I'm not sure how to tell which one is my new popup. If I have multiple Chrome windows running, it appears that each real window has another invisible handle created. I suppose I could capture the existing window handles when Chrome starts up, before the popup appears, then watch for a new different one (as long as I don't open another Chrome window). I'll play with that idea. Still, I wonder if there's a way to use the X/Y/W/H as implied in the docs since the popup always appears in the same place?
  10. You are assuming that the _IEaction "click" will do the same as a 'mouseclick' on a gui application...that is not a correct assumption.
  11. Hi All, I have a project where i monitor a system that connects to dozens of temperature sensors and I require the following; Program 1 imports a text file row items into an array/list on launch, This will define what string pattern I am looking for and how many items to use Program 1 then checks this array/list against a string that is being sent to say Windows COM1, whenever an event occurs Program 1 then checks the string eg. "TEMP001-ALARM" and writes this to a log file with time stamp if it matches an item in the list/array Program 1 or another Program 2 monitors this log file an on "TEMP001-ALARM" it triggers an email saying Temperature 1 is in Alarm When Program 1 gets sent "TEMP001-NORMAL" string to COM1 it writes this to the log file and time stamps it Program 2 then sees this chnange from alarm back to normal and sends an email stating Temperature 1 alarm has cleared Must support up to 100 temperature alarms Must support 7 days logging, possibly copying a backup and overwriting every 7 days etc. Reason I am looking at AutoIT is because of the GUI functions were I could launch these 1/2 programs from and have status of "Running" or "Off" and also display the log in like a console window inside the GUI, possibly also editing the rows it imports from this GUI as well. Is this too ambitious a project for AutoIT? I have VBScript, PHP and Python experience but not fluent enough to get everything into a GUI. This would work really well if its doable. Has anyone done something similar? Advice? Many Thanks.
  12. I dont need to set any values, i just need the input box to be clicked. Focus worked, thank you. What i dont understand is why CLICK does not work but FOCUS does. No way i'd assume i need to focus on an element when i am trying to click it lol
  13. Not enough info, so I'll take a stab in the dark...throw in this additional line: $IE = _IEAttach($WinTitle) _IELoadWait($IE) ;make sure loaded $IEObject = _IEGetObjByname($IE, "txtSearch") ; _IEAction($IEObject, "click") _IEAction($IEObject, "focus") ; now set the text, and then do a blur: _IEAction($IEObject, "blur") As for combo boxes, use this to set the value: _IEFormElementOptionSelect
  14. I need the buttons for the d-pad, x and a buttons.
  15. Yeah no worries. I appreciate you even looking at all. Have a great night and thank you.
  16. You can do a winlist based on the class...then loop until an additional window is included in the array...use that handle to do your additional scripting.
  17. Then my second snippet would work.
  18. Hey guys, I'm sure if you frequent the forums then you have seen my recent postings, and I apologize for being so incapable, that being said I want to send out a genuine thank you to the people of this forum who spend time helping others here and holding the hand of newbies like me. Honestly I never thought I would be able to "program" and the only reason why I started on autoit was because I figure it would be easier then a "real" programming language and I just wanted to click a few buttons and then I would stop, but I got addicted . Also I'm shocked at the power and ease of use of autoit everyday, and honestly there doesn't seem to be much that it's not capable of doing with the help of people on this forum who have developed libraries/UDF's/whatever. Anyways, I've now worked on 5-10+ projects both for myself and to help automate the life of others, and the one difference between any other language and autoit are the phenomenal forum help found here. So basically, THANKS GUYS (and GIRLS). Once I am proficient (if it ever happens) then I hope to repay the forums by helping here as well.
  19. Yesterday
  20. I'm trying to create a script that watches for a small popup to appear, then captures it for me (either an image or the contents). The popup is created by a Chrome browser plugin called "Pandora Enhancer". Whenever a song changes in Pandora, the plugin creates the small popup display showing info about the song. Unfortunately, Au3Info shows no window title, and the class is the same the main Pandora browser window, and the handle varies each time it pops up. The only other possibility is that the Window Matching Modes of AutoIt appear to be able to find a window based upon X/Y/W/H. However, the help file and other sources don't show me the syntax I'd need to use this, if it's even doable. The popup position is 1550,950 and the size is 360,80. What's the syntax to match a window based upon position and size? Will this idea even work? Are there any alternatives?
  21. Got it. As it should work from shell:sendto I worked only with $CmdLine: #include <Constants.au3> If $CmdLine[0] < 1 Then Exit Local $sScriptFullPath = $CmdLine[1] Local $sCompileStyle = _isCUIorGUI($sScriptFullPath) If @error Then MsgBox(0, 'CUI_or_GUI', "There is no valid result." & @CRLF & @CRLF & "Error: " & @error & @CRLF & "Extended: " & @extended) Else MsgBox(0, 'CUI_or_GUI', $sScriptFullPath & @CRLF & "is compiled as: " & $sCompileStyle) EndIf Exit Func _isCUIorGUI($sScriptFullPath) ; parts by ljcorsa Local $result = False SetError(0, 1) Local Const $magicValueGUI = 0x2 Local Const $magicValueCUI = 0x3 Local Const $iOffsetDecPEtoCuiGuiByte = 92 Local $magicPosition If StringInStr($sScriptFullPath, ".exe") Then ; is compiled? Local $exeFileHandle = FileOpen($sScriptFullPath, 16) Local $HeaderSearch = FileRead($exeFileHandle) $HeaderSearch = StringTrimLeft($HeaderSearch, 2) Local $iOffsetDecPEHeader = (StringInStr($HeaderSearch, "50450000") - 1) / 2 ; 50450000 is HEX-Code for PE.. (. means NULL) Local $magicPositionDecimal = $iOffsetDecPEHeader + $iOffsetDecPEtoCuiGuiByte $magicPositionDecimal = Int($magicPositionDecimal) $magicPosition = "0x" & Hex($magicPositionDecimal) If (-1) <> $exeFileHandle Then ; - if can't open, read, or fileseek the executable file in which I'm running, fail If FileSetPos($exeFileHandle, $magicPosition, $FILE_BEGIN) Then Local $byte = FileRead($exeFileHandle, 1) If 0 = @error Then If $magicValueGUI = $byte Then ; - if the value at the magic position is 0x2, succeed! SetError(0, 0) $result = "GUI" ElseIf $magicValueCUI = $byte Then ; - if the value at the magic position is 0x3, succeed! SetError(0, 0) $result = "CUI" Else SetError(1, 5) EndIf Else SetError(1, 4) EndIf Else SetError(1, 3) EndIf Else SetError(1, 2) EndIf Else SetError(1, 1) EndIf Return $result EndFunc Conrad
  22. I am trying to click inputbox. $IE = _IEAttach($WinTitle) _IELoadWait($IE) ;make sure loaded $IEObject = _IEGetObjByname($IE, "txtSearch") _IEAction($IEObject, "click") Nothing happens unless i click it with mouse. It ONLY works for buttons but not for an inputs and combo boxes. Maybe inputs and combos i try to click are none standard ? Here is a code from the page for the input. <INPUT onkeypress=ValidationForCatalogandInventoryText();CheckScan(); onkeyup=EnableSearchButton(); onfocus=RemoveScanText(; onblur=SystemSettingsTrim();SetScanText(false); id=txtSearch class=textbox onpaste=EnableSearchButton();OnPasteDisallowSpecialChars(); style="BACKGROUND-COLOR: white" ondrop="OnDragDropDisallowSpecialChars('btnSearch');" maxLength=15 value="Scan an item ..." name=txtSearch> Thats where i want to click. thanks !
  23. 8 years yet i landed here when i was searching for answers. I think its best to keep adding to the thread VS creating new once containing same information over and over and over again, cluttering sql database. But what do i know. Ill do what you say.
  24. No need to quote.
  25. I'm not sure if those meet the OP's requirements. I think he wanted to be able to drag the window from anywhere in the GUI, not just the title bar. I guess he can chime in with his input; but I appreciate more examples for him to look at.
  26. Thx for your answer .. i looked at this topic but youtube has updated his API and this "YTAPI UDF" is not working any more.
  27. func sigmoid($x) return 1 / 1 * math.exp(-$x) endfunc Tried it. seems good:) looks complicatied 2 me @RTFC but i was hoping for something like this in Java but whitout the use of dll’s
  28. This one also corrects the capitalization of 'line' while we are being all needy ConsoleWrite(stringreplace(StringStripWS(StringReplace(StringStripCR(FileRead("txt.txt")) , @LF & @LF , @CRLF) , 4) , @LF & "l" , @LF & "L"))
  1. Load more activity