Nine Posted February 23, 2021 Posted February 23, 2021 Try running x64 and/or #RequireAdmin I suppose that if you press down key, it works ? Because if Send does not work, I wonder what would... “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Debug Messages Monitor UDF Screen Scraping Round Corner GUI UDF Multi-Threading Made Easy Interface Object based on Tag
BruceGC Posted February 23, 2021 Author Posted February 23, 2021 My oringal code was able to select the correct sex that the $Male and $Female showed it just was not updating with the cell from $Data using my if statement. When I use your If /ElseIf it activates the dropdown box but fails to select the sex so it stop before the MouseClick instruction. We know that $Data is picking up the correct cell info. Should I make a break point after the ElseIF to catch if the $Data is being passed on correctly? I guess that is what the messagebox is telling us. I have tried removing the trailing spaces from Excel and the If statement. no differance and I have tried using number instead of Male / Female. This is just the last step to crack before I can start importing records. Would have been a lot easier if the guy who wrote the database didnt have a bug in the "Import Records" area. I would write my own database for it which would have been quicker but I get stuck with the inbreeding coefficient formula. Anyway. Thanks for helping, I will bang on and see if I can find where this is getting stuck. Cheers Bruce
BruceGC Posted February 23, 2021 Author Posted February 23, 2021 I just tried to send the letter of the word within the dropbox as this works manually If $Data = "Female " Then Send("F") ;MouseClick("left",268,148,1) ; Select Female Sleep (500) ElseIf $Data = "Male " Then Send("M") ;MouseClick("left",227,130,1) ; Select Male Sleep (500) EndIf But no joy.
BruceGC Posted February 23, 2021 Author Posted February 23, 2021 Nope still activates the dropdown but nothing becomes selected or highlighted, does it require a click?
Nine Posted February 23, 2021 Posted February 23, 2021 Try this : If StringStripWS($Data, 8) = "Female" Then MouseClick("left",268,148,1) ; Select Female Else MouseClick("left",227,130,1) ; Select Male EndIf Sleep (500) “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Debug Messages Monitor UDF Screen Scraping Round Corner GUI UDF Multi-Threading Made Easy Interface Object based on Tag
BruceGC Posted February 23, 2021 Author Posted February 23, 2021 Still not selecting anything in the box. yet $Male = MouseClick("left",227,130,1) ;Select Male $Female = MouseClick("left",268,148,1) ; Select Female these strings select the corrcet sex
BruceGC Posted February 23, 2021 Author Posted February 23, 2021 this will sound odd but, how long is the data stored in a string? By displaying it in the message box remove it from $Data?
BruceGC Posted February 23, 2021 Author Posted February 23, 2021 I have moved the MessBox to below the If Statement and it now runs to the point where it selects Male
BruceGC Posted February 23, 2021 Author Posted February 23, 2021 I have changed the word Female to Orange both on the spreadsheet and within the If statement and it works Yah Yah so there must be another call for Female or it os formatted in excel or something along that path. Thanks so much for your help. It is only 1:49 Am here and I've been at this all day so I'm off to bed. Thanks again Bruce
FrancescoDiMuro Posted February 23, 2021 Posted February 23, 2021 Just now, BruceGC said: It is only 1:49 Am here and I've been at this all day so I'm off to bed Good night 😴 Click here to see my signature: Spoiler ALWAYS GOOD TO READ: Forum Rules Forum Etiquette
BruceGC Posted February 23, 2021 Author Posted February 23, 2021 MouseClick("left",902,695,1) ;Select New Dog window _WinWaitActivate("New Dog","") ; Back to New Dog MouseClick("left",233,101,1) ;open sex Sleep (1000) $Data = ClipGet() If StringStripWS($Data, 8) = "Orange" Then MouseClick("left",268,148,1) ; Select Female Else MouseClick("left",227,130,1) ; Select Male EndIf Sleep (500) MsgBox($Data, "Title", "This is the sex copied " & $Data & " select the OK button.",10)
Nine Posted February 23, 2021 Posted February 23, 2021 (edited) Ahhh, found the problem. There is a no-break-space (0xA0) at the end of the sex field. You can see it with the snippet I provided. Both Male and Female. #include <Excel.au3> Local $hWnd = WinGetHandle("New Dog") Local $oExcel = _Excel_Open() Local $oWorkBook = _Excel_BookOpen($oExcel, @ScriptDir & "\pedproimport2.xls") Local $sData = _Excel_RangeRead($oWorkBook, Default, "B2") ; testing content for male ConsoleWrite (Binary($sData) & @CRLF) $sData = _Excel_RangeRead($oWorkBook, Default, "B3") ; now testing for female ConsoleWrite (Binary($sData) & @CRLF) WinActivate($hWnd) ; where $hWnd equals the pedpro window handle WinWaitActive($hWnd) MouseClick("left",233,101,1) ;open sex Sleep(800) ; trim A0 char If StringTrimRight($sData, 1) = "Female" Then ; now it is working properly :) ConsoleWrite ("Female Found" & @CRLF) MouseClick("left",268,148,1) ; Select Female Else MouseClick("left",227,130,1) ; Select Male EndIf Sleep (500) Edited February 23, 2021 by Nine “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Debug Messages Monitor UDF Screen Scraping Round Corner GUI UDF Multi-Threading Made Easy Interface Object based on Tag
Nine Posted February 23, 2021 Posted February 23, 2021 (edited) Here the framework of how you could do your xfer. Notice I don't use clipboard, as it is not necessary. That should work quite well. expandcollapse popup#include <Excel.au3> ;Local $hWnd = WinGetHandle("New Dog") Local $oExcel = _Excel_Open() Local $oWorkBook = _Excel_BookOpen($oExcel, @ScriptDir & "\pedproimport2.xls") ;WinActivate($hWnd) ; where $hWnd equals the pedpro window handle ;WinWaitActive($hWnd) Local $aArray, $sField For $line = 2 To 3 ; 1919 $aArray = _Excel_RangeRead($oWorkBook, Default, "A" & $line & ":AI" & $line) ;_ArrayDisplay($aArray) For $i = 0 To UBound($aArray, 2) - 1 $sField = $aArray[0][$i] ;ConsoleWrite ($i+1 & " Field = " & Binary($sField) & @CRLF) If Asc(StringRight($sField, 1)) = 0xA0 Then $sField = StringTrimRight($sField, 1) ;ConsoleWrite ("Found A0 here" & @CRLF) EndIf Switch $i Case 0 ; do your xfer of the pedigree Case 1 ; gender MouseClick("left", 233, 101, 1) ;open sex Sleep (800) If $sField = "Female" Then ; now it is working properly :) MouseClick("left", 268, 148, 1) ; Select Female Else MouseClick("left", 227, 130, 1) ; Select Male EndIf Sleep(500) Case 2 ; do your xfer of the name ; Case etc....rest of the field EndSwitch Next ; close the record here and start new record Next You will need to complete the transfer of each field. I gave you just gender. You can uncomment statements to see a bit more of what it is going on. Edited February 23, 2021 by Nine “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Debug Messages Monitor UDF Screen Scraping Round Corner GUI UDF Multi-Threading Made Easy Interface Object based on Tag
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