middae
Members-
Posts
15 -
Joined
-
Last visited
middae's Achievements
Seeker (1/7)
0
Reputation
-
I have noticed this in both VBA(Excel 2000) and AutoIt. Many times, the only way to get information from a window is to highlight and Ctrl+C to send it to the clipboard. Then I use ClipGet() or equiv. vba code to retrieve the contents and parse the resulting string. What I've noticed is that clipboard content retrieval will occasionally lag behind, resulting in either prior data, or not all data being retrieved. For Example. Clipboard contains "AB1" ClipGet() - results in "AB1" do stuff, highlight, send CTRL-C on "CD2" ClipGet() - results in "" or "AB1" This only happens every once in awhile. If I have notepad open, and notice the ClipGet() is resulting the wrong info, I can Ctrl_V into Notepad, and it shows the new stuff that was supposed to be retrieved. I guess it's missing a tick or the clipboard data on another process or something. I used to ClipPut() a "CLEAR", and compare ClipGet() to it to see if it got the new info or not, but ClipGet() still may result in erroneous information. Thoughts on always getting the proper info?
-
Well, I dont see a snippet over here, but - I'd just read a string, break the string into an array at CRLF (char 13 and 10) then make a second array of equal length. Then, itterate through Array1 index by index, and then take that string, run the length, and rebuild it character by character For $x = 1 to Len($strIN) if Mid($strIN,$x,1) = [A-A,a-a,0-9] then $strOut = $strOut + Mid($strIN, $x, 1) end if next Array2[y] = $strOut that's kinda pseudo code for ya. Or, you can use Replace functions to remove non-necessary characters. Regex for stripping strings of characters isn't such a good idea in my experience. Too complex.
-
IDing a button press in another program
middae replied to middae's topic in AutoIt General Help and Support
Oh snap - brilliant!! -Mid -
I'm gonna use an example in psuedocode - Page2 = innterhtml has "Second" in it. This is our desired page. It's important that the page you're leaving from does not have "Second" in it. So, find some identifier or even use the address of the page. $PageText = "" While instr($PageText,"Second") = 0 ;since $pagetext is empty, this will definitly run at least 1 time. _IE.button(whatever).click ;assumes we're on page1. while IE.busy ;waits for IE to finish it's loading of new page. DoEvents Wend $PageText = IE.innerhtml ;set $pagetext for the 'next' while loop to check. wend Does that help? =)
-
IDing a button press in another program
middae replied to middae's topic in AutoIt General Help and Support
Is that going to let AutoIt know when the button is pressed by human rather than by AutoIt? -
I wrote something similiar a while back. I basically had a structure like this: Redo: ie.Navigate/click/whatever PageImSupposedToBeAt While ie.busy DoEvents Wend If inString(CertainIdentifiableStringAlwaysInAPage,ie.document.innerhtml) = False GoTo Redo End if You might consider keeping a counter in the event it loops so many times it really becomes an infinite loop. I know it's messy, but it worked for tedious things. Or use a while loop, and avoid the GoTo command. Many possibilities.
-
ProgramB - 3rd party program, has a small window pop up titled "Done Scanning". On this window, is a button, labeled "Done" Can I have my script identify when the "Done" button is pressed on this other program? I don't have a clue where to begin on this... Thanks in advance!
-
AutoIT and VB any similarities?
middae replied to xandout's topic in AutoIt General Help and Support
Here's how I learned a lot of VB. Opened Word, and started MacroRecorder. Did some things, then Opened the macro in the VBA editor in word. It's pretty easy once you realize it's all "Object.Method" driven. Then there's plenty of websites to help also, AND vba and Vb are so closely tied together, it's easy to move from one to the next. VB.Net - a little more difficult though, imo. -
send keystrokes in a diffrent way
middae replied to mnmltechno's topic in AutoIt General Help and Support
Try finding the control's winhandle, and ControlSending -
Yes, sorry, I get my ListBox and ListView mixed up. It's a ListView. ColA | ColB | ColC | ColdD Data | Data1 | Data | Data Data | Data2 | Data | Data Data | Data3 | Data | Data I'm trying to click Column Header (or send some Sort_Descending command) for ColB to make it in Descending order ColA | ColB | ColC | ColdD Data | Data3 | Data | Data Data | Data2 | Data | Data Data | Data1 | Data | Data Reading your code, I assume $Struct is a created type, and that the uint's are ..how many columns the listview has?
-
I'm hoping I'm not relegated to OCRing across the screen until I find a good pxchksum and then mouseclicking there. =/ _GuiCtrlListBox_Sort doesn't offer a way to sort by column. =/
-
So I've looked through help file, and ran over the forum; but haven't found an answer (or didn't see it) to the following question: ProgramA (not an AutoIt gui) has a listbox, and I have the $hwnd to that listbox. This list has several columns with headers. Is there a way to send a command, besides mouseclicking, to Sort the list by the Second column?
-
Turns out I had to Enumerate the windows and look for "ListBox " with a space at the end. Unless there's a way to specify a trailing character on the end of a Title? [CLASS:AfxWnd80sd; TITLE:"ListBox "] doesn't work. My Solution: Func FindHDILB() ;Returns "AfxWnd80sd:ListBox " handle $aWindows = _WinAPI_EnumWindows() For $i = 1 To UBound($aWindows) - 1 if $aWindows[$i][1] = "AfxWnd80sd" Then if WinGetTitle($aWindows[$i][0]) = "ListBox " Then $hLB = $aWindows[$i][0] EndIf EndIf Next Return $hLB EndFunc Assigned $hdi = FindHDILB(); then WinGetPos($hdi), and MouseMove($pos[0],$pos[1]) got me where I needed to go. Returned the proper value every time, yippee!
-
Isn't that what this does? I thought I read Opt and AutoItSetOption where interchangable? AutoItSetOption("WinSearchChildren","1") And ChildC is being found in ProgA, I use some MouseMoves to move to the top-left corner of it on occasion. It's finding That Listbox of class AfxWnd80sd in ChildC that's a problem. I'm so frustrated. heh.
-
I have a program - we'll call it ProgA. This program has child windows: ChildA, ChildB, ChildC ChildC has several listboxes. One is resizeable and takes up the maority of the window, and lists a 4 column spread of information. I'm trying to figure out where Column 2 starts in this Listbox. Here's the AutoIt tool info from that window. Of Course, instance changes frequently. I thought I'd use ControlGetPos or WinGetPos, but both keep returning errors. WinGetPos gets me the closest, #include <GuiConstantsEx.au3> #include <WinAPI.au3> #include <Debug.au3> AutoItSetOption("WinTitleMatchMode","1") AutoItSetOption("WinSearchChildren","1") $hDIM = WinGetHandle("ChildC") $pos = WinGetPos("[CLASS:AfxWnd80sd]","Listbox") Mousemove($pos[0],$pos[1],5) After identifying the Control position, I was planning to move pixel by pixel along X, until my pxchksum (basically OCR the screen) until I find a certain word ("Batch #"). If I can find that, I can click that heading in the listbox, and sort appropriately. I've been stuck on guaranteeing I come up with the correct AfxWnd80sd control. Most of the errors are: control not found, or finding the incorrect AfxWnd80sd controls (there are 3 or 4 at a time in ProgA. "ListBox" as text errors out using both WinGetPos and ControlGetPos.