
trdunsworth
Members-
Posts
14 -
Joined
-
Last visited
Recent Profile Visitors
The recent visitors block is disabled and is not being shown to other users.
trdunsworth's Achievements

Seeker (1/7)
0
Reputation
-
Thank you all. SmOke_N Nope, Not a lawyer, work with a sheriff's office. However, I know where you're coming from with that. I should have thought about making those global. With the two arrays, those are going to change size in each place, so I'm thinking just set them as eg. Global $aInputVal[] and then add the correct parameter lists in the individual tabs. Jfish, I might end up going with that. Either way, I appreciate both of the ideas and I will incorporate them in this. Yes, it's going to be huge when it finishes out. However, down the road, I can see it modularized better.
-
trdunsworth reacted to a post in a topic: Is it possible
-
trdunsworth reacted to a post in a topic: Is it possible
-
Sorry the whole thing is several hundred lines. So I was trying to edit for time purposes. I figured you wouldn't want to read some of the other stuff in there. The second function is called in the first above it. (Not my code, I'm incorporating the other code and trying to finish off the wiring. #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <EditConstants.au3> #include <WindowsConstants.au3> #include <DateTimeConstants.au3> #include <IE.au3> #include <InetConstants.au3> #include <StringConstants.au3> #include <FileConstants.au3> #include <Excel.au3> #include <MsgBoxConstants.au3> ; Changes to OnEvent Mode Opt('GUIOnEventMode', 1) AutoItSetOption("WinTitleMatchMode",2) AutoItSetOption("MouseCoordMode", 2) GUICreate("JCSO NCIC Entry", 1500, 900) GUISetOnEvent($GUI_EVENT_CLOSE, 'GUIExit') GUISetIcon("icon.ico") Global $sFont = "Calibri" ;LICENSE VARIABLES Global $FLmke Global $FLori Global $FLlic Global $FLlis Global $FLliy Global $FLlit Global $FLdot Global $FLoca Global $FLnic Global $FLlki Global $FLlka Global $FLnoa Global $FLmis Global $FLdor Global $FLofc Global $FLdoe Global $FLop1 Global $FLdo2 Global $FLop2 Global $FLdom Global $FLop3 Global $FLdoc Global $FLop4 ;MISSING PERSON VARIABLES Global $FMmke Global $FMori Global $FMdlc Global $FMoca Global $FMmnp Global $FMmpc Global $FMnoa Global $FMnam Global $FMsex Global $FMrac Global $FMpob Global $FMdob Global $FMhgt Global $FMwgt Global $FMeye Global $FMhai Global $FMfbi Global $FMskn Global $FMsmt Global $FMfpc Global $FMmnu Global $FMsoc Global $FMdna Global $FMdlo Global $FMcmc Global $FMctz Global $FMbxr Global $FMcrc Global $FMvrx Global $FMblt Global $FMfpa Global $FMoln Global $FMols Global $FMoly Global $FMlic Global $FMlis Global $FMliy Global $FMlit Global $FMvin Global $FMvyr Global $FMvma Global $FMvst Global $FMvco Global $FMlki Global $FMlka Global $FMjwl Global $FMjwt Global $FMmis Global $FMnic Global $FMdor Global $FMdoe Global $FMdo2 Global $FMdom Global $FMdoc Global $FMofc Global $FMop1 Global $FMop2 Global $FMop3 Global $FMop4 ;WARRANTS VARIABLES Global $FWmke Global $FWori Global $FWnam Global $FWsex Global $FWrac Global $FWpob Global $FWdob Global $FWhgt Global $FWwgt Global $FWeye Global $FWhai Global $FWfbi Global $FWskn Global $FWsmt Global $FWfpc Global $FWmnu Global $FWsoc Global $FWdna Global $FWdno Global $FWcmc Global $FWctz Global $FWetn Global $FWoff Global $FWdow Global $FWoca Global $FWwno Global $FWcti Global $FWnoa Global $FWexl Global $FWado Global $FWlki Global $FWlka Global $FWoln Global $FWols Global $FWoly Global $FWlic Global $FWlis Global $FWliy Global $FWlit Global $FWvin Global $FWvyr Global $FWvma Global $FWvmo Global $FWvst Global $FWvco Global $FWfnam Global $FWfdob Global $FWfsoc Global $FWfmnu Global $FWfoln Global $FWfols Global $FWfoly Global $FWadd Global $FWdda Global $FWsnu Global $FWsna Global $FWcty Global $FWsta Global $FWzip Global $FWcou Global $FWmis Global $FWocc Global $FWnic Global $FWdor Global $FWdoe Global $FWdo2 Global $FWdom Global $FWdoc Global $FWofc Global $FWop1 Global $FWop2 Global $FWop3 Global $FWop4 ; PROTECTION ORDER VARIABLES Global $FPmke Global $FPori Global $FPnam Global $FPsex Global $FPrac Global $FPpob Global $FPdob Global $FPhgt Global $FPwgt Global $FPeye Global $FPhai Global $FPfbi Global $FPskn Global $FPetn Global $FPsmt Global $FPfpc Global $FPmnu Global $FPsoc Global $FPdna Global $Fpdlo Global $FPcmc Global $FPctz Global $FPpco Global $FPbrd Global $FPisd Global $FPoca Global $FPpno Global $FPexp Global $FPcti Global $FPnoa Global $FPoln Global $FPols Global $FPoly Global $FPlic Global $FPlis Global $FPliy Global $FPlit Global $FPvin Global $FPvyr Global $FPvmo Global $FPvst Global $FPvco Global $FPpnam Global $FPpdob Global $FPpsex Global $FPprac Global $FPpsoc Global $FPmis Global $FPnic Global $FPdor Global $FPdoe Global $FPdo2 Global $FPdom Global $FPdoc Global $FPofc Global $FPop1 Global $FPop2 Global $FPop3 Global $FPop4 ; VEHICLE VARIABLES Global $FVmke Global $FVori Global $FVdot Global $FVoca Global $FVoan Global $FVopt Global $FVlic Global $FVlis Global $FVliy Global $FVlit Global $FVvin Global $FVvyr Global $FVvma Global $FVvmo Global $FVvst Global $FVvco Global $FVnoa Global $FVlki Global $FVlka Global $FVimn Global $FVimt Global $FVnic Global $FVdor Global $FVdoe Global $FVdo2 Global $FVdom Global $FVdoc Global $FVofc Global $FVop1 Global $FVop2 Global $FVop3 Global $FVop4 ; DROP DOWN ARRAYS Global $stateArray[66] = ["Alabama", "Alaska", "Alberta", "Arizona", "Arkansas", "British Columbia", "California", "Colorado", "Connecticut", "Delaware", "District of Columbia", "Florida", "Georgia", "Gov't Plate", "Hawaii", "Idaho", "Illinois", "Indiana", "Iowa", "Kansas", "Kentucky", "Louisiana", "Maine", "Manitoba", "Maryland", "Massachusets", "Mexico", "Michigan", "Minnesota", "Mississippi", "Missouri", "Montana", "Nebraska", "Nevada", "New Brunswick", "Newfoundland & Labrador", "New Hampshire", "New Jersey", "New Mexico", "New York", "North Carolina", "North Dakota", "Northwest Territories", "Nova Scotia", "Ohio", "Oklahoma", "Ontario", "Oregon", "Pennsylvania", "Prince Edward Island", "Quebec", "Rhode Island", "Saskatchewan", "South Carolina", "South Dakota", "Tennessee", "Texas", "Utah", "Vermont", "Virginia", "Washington", "West Virginia", "Wisconsin", "Wyoming", "Yukon Territory", "Other"] Global $ptArray[29] = ["Passenger Car", "Personalized", "Ambulance", "Antique", "Apportioned", "Profession", "Legislator", "Justice", "Law Enforcement", "Handicapped", "Organization", "Motorcycle", "Truck-Tractor", "Trailer (all)", "Disabled Veteran", "Dealer (Auto)", "Doctor", "Amateur Radio", "College", "Temporary", "State Owned", "County", "Municipal", "Taxi", "U.S. Govt. Vehicle", "Truck", "Military Vehicle", "Manufacturer", "POW"] Global $raceArray[7] = ["Alaskan Native", "American Indian", "Asian", "Black", "Pacific Islander", "Unkown", "White"] Global $categoryArray[3] = ["Stolen/Missing Lic (All Issued) - 14", "Stolen/Missing Lic (Single Place) - 15", "Lost License/Tag - 16"] Global $missingArray[8] = ["Catastrophe Victim", "Contact Witness Program", "Disappearance Involuntary", "Juvenile Other (13-17 yoa)", "Adult Other (specify in remarks)", "Physically or Mentally Disabled", "Physical Safety Endangered", "Walkaway"] Global $sexArray[3] = ["Male", "Female", "Unknown"] Global $eyeArray[10] = ["Black", "Blue", "Brown", "Green", "Grey", "Hazel", "Maroon", "Multi Color", "Pink", "Unknown"] Global $hairArray[13] = ["Black", "Blond-Strawberry", "Blue", "Brown", "Green", "Grey", "Orange", "Pink", "Purple", "Red or Auburn", "Sandy", "White", "Unknown"] Global $skinArray[13] = ["Albino", "Black", "Dark", "Dark Brown", "Fair", "Light", "Light Brown", "Medium Brown", "Medium", "Olive", "Ruddy", "Sallow", "Yellow"] Global $extrArray[10] = ["Full Extradition - (1)", "Limited U.S Extradition - (2)", "Extradition - Surrounding States Only - (3)", "Extradition Limited Missouri Only - (4)", "Pending Extradition - (5)", "Intrastate (Entire State) - (S)", "Partial Intrastate - (P)", "Adjoining Counties - (C)", "Greater Metro Area(Local area) - (L)", "No Extradition - (N)"] Global $cmcArray[16] = ["Alcoholic", "Allergies", "Armed and Dangerous", "Diabetic", "Epilepsy", "Escape Risk", "Explosives Expertise", "Heart Condition", "Hemophiliac", "Known to Abuse Drugs", "Martial Arts Expertise", "Medication Required", "Other - Enter Caution Description", "Sexually Violent Predator", "Suicidal", "Violent Tendencies"] Global $rgbArray[34] = ["Amethyst (purple)", "Beige", "Black", "Blue", "Bronze", "Brown", "Burgundy (purple)", "Camouflage", "Chrome", "Copper", "Cream", "Dark Blue", "Gold", "Gray", "Green", "Dark Green", "Light Green", "Ivory", "Lavendar (purple)", "Light Blue", "Maroon", "Mauve (purple)", "Multicolored", "Orange", "Pink", "Purple", "Red", "Silver", "Tan", "Taupe (brown)", "Teal (green)", "Turquoise (blue)", "White", "Yellow"] Global $vcatArray[8] = ["Failure To Return-41","Miscellaneous-45","Owner Forgot Where Parked-42","Repossessed-60","Stolen Vehicle-10","Wanted Felony-20","Wanted Misdemeanor-21","Wanted Ordinance-22"] $stateList = "" For $i = 0 To UBound($stateArray,1) -1 $stateList &= "|" & $stateArray[$i] Next $ptList = "" For $j = 0 To UBound($ptArray,1) -1 $ptList &= "|" & $ptArray[$j] Next $raceList = "" For $k = 0 to UBound($raceArray,1) -1 $raceList &= "|" & $raceArray[$k] Next $catList = "" For $l = 0 to UBound($categoryArray,1) -1 $catList &= "|" & $categoryArray[$l] Next $missList = "" For $m = 0 to UBound($missingArray,1) -1 $missList &= "|" & $missingArray[$m] Next $sexList = "" For $n = 0 to UBound($sexArray,1) -1 $sexList &= "|" & $sexArray[$n] Next $eyeList = "" For $o = 0 to UBound($eyeArray,1) -1 $eyeList &= "|" & $eyeArray[$o] Next $hairList = "" For $p = 0 to UBound($hairArray, 1) -1 $hairList &= "|" & $hairArray[$p] Next $skinList = "" For $q = 0 to UBound($skinArray, 1) -1 $skinList &= "|" & $skinArray[$q] Next $extrList = "" For $r = 0 to UBound($extrArray, 1) -1 $extrList &= "|" & $extrArray[$r] Next $cmcList = "" For $s = 0 to UBound($cmcArray, 1) -1 $cmcList &= "|" & $cmcArray[$s] Next $rgbList = "" For $t = 0 to UBound($rgbArray, 1) -1 $rgbList &= "|" & $rgbArray[$t] Next $vcatList = "" For $u = 0 to UBound($vcatArray, 1) -1 $vcatList &= "|" & $vcatArray[$u] Next ;Menu Creation Local $filemenu = GUICtrlCreateMenu("&File") Local $helpmenu = GUICtrlCreateMenu("?") Local $openItem = GUICtrlCreateMenuItem("&Open", $filemenu) Local $saveItem = GUICtrlCreateMenuItem("&Save", $filemenu) Local $infoItem = GUICtrlCreateMenuItem("Info", $helpmenu) Local $exitItem = GUICtrlCreateMenuItem("E&xit", $filemenu) ;Tab Creation GUICtrlCreateTab(0,0,1500,880) ;Create the License Plate Tab GUICtrlCreateTabItem("License Plate") ;Create the form labels GUICtrlCreateLabel("Message Key (MKE)", 20, 40, 200, 75) GUICtrlSetFont(-1, 10, 700, 1, $sFont, 5) GUICtrlCreateLabel("Originating Agency (ORI)", 20, 80, 200, 75) GUICtrlSetFont(-1, 10, 700, 1, $sFont, 5) GUICtrlCreateLabel("License Plate No. (LIC)", 20, 120, 200, 75) GUICtrlSetFont(-1, 10, 700, 1, $sFont, 5) GUICtrlCreateLabel("License Plate St. (LIS)", 20, 160, 200, 75) GUICtrlSetFont(-1, 10, 700, 1, $sFont, 5) GUICtrlCreateLabel("Expiration Year (LIY)", 20, 200, 200, 75) GUICtrlSetFont(-1, 10, 700, 1, $sFont, 5) GUICtrlCreateLabel("License Plate Type (LIT)", 20, 240, 200, 75) GUICtrlSetFont(-1, 10, 700, 1, $sFont, 5) GUICtrlCreateLabel("Date of Theft (DOT)", 20, 280, 200, 75) GUICtrlSetFont(-1, 10, 700, 1, $sFont, 5) GUICtrlCreateLabel("Case Number (OCA)", 20, 320, 200, 75) GUICtrlSetFont(-1, 10, 700, 1, $sFont, 5) GUICtrlCreateLabel("NCIC Number (NIC)", 20, 360, 200, 75) GUICtrlSetFont(-1, 10, 700, 1, $sFont, 5) GUICtrlCreateLabel("Linking Agency Id (LKI)", 20, 400, 200, 75) GUICtrlSetFont(-1, 10, 700, 1, $sFont, 5) GUICtrlCreateLabel("Linking Case Number (LKA)", 20, 440, 200, 75) GUICtrlSetFont(-1, 10, 700, 1, $sFont, 5) GUICtrlCreateLabel("Notify Originating Agency (NOA)", 20, 480, 200, 75) GUICtrlSetFont(-1, 10, 700, 1, $sFont, 5) GUICtrlCreateLabel("Miscellaneous Info (MIS)", 20, 520, 200, 75) GUICtrlSetFont(-1, 10, 700, 1, $sFont, 5) GUICtrlCreateLabel("ENTRY & SECOND PARTY CHECK", 550, 40, 200, 75) GUICtrlSetFont(-1, 10, 700, 6, $sFont, 5) GUICtrlCreateLabel("", 500, 60, 200, 75) GUICtrlCreateLabel("Date Received", 500, 80, 200, 75) GUICtrlSetFont(-1, 10, 700, 1, $sFont, 5) GUICtrlCreateLabel("Date of Entry", 500, 160, 200, 75) GUICtrlSetFont(-1, 10, 700, 1, $sFont, 5) GUICtrlCreateLabel("Date of Second Party Check", 500, 240, 200, 75) GUICtrlSetFont(-1, 10, 700, 1, $sFont, 5) GUICtrlCreateLabel("Modify Date", 500, 320, 200, 75) GUICtrlSetFont(-1, 10, 700, 1, $sFont, 5) GUICtrlCreateLabel("Clear, Cancel, or Locate Date", 500, 400, 200, 75) GUICtrlSetFont(-1, 10, 700, 1, $sFont, 5) GUICtrlCreateLabel("Officer/Agency", 500, 120, 200, 75) GUICtrlSetFont(-1, 10, 700, 1, $sFont, 5) GUICtrlCreateLabel("Operator", 500, 200, 200, 75) GUICtrlSetFont(-1, 10, 700, 1, $sFont, 5) GUICtrlCreateLabel("Operator", 500, 280, 200, 75) GUICtrlSetFont(-1, 10, 700, 1, $sFont, 5) GUICtrlCreateLabel("Operator", 500, 360, 200, 75) GUICtrlSetFont(-1, 10, 700, 1, $sFont, 5) GUICtrlCreateLabel("Operator", 500, 440, 200, 75) GUICtrlSetFont(-1, 10, 700, 1, $sFont, 5) ;Create the Input parameters $FLmke = GUICtrlCreateCombo("", 225, 40, 200, 25) $FLori = GUICtrlCreateInput("", 225, 80, 200, 25) $FLlic = GUICtrlCreateInput("", 225, 120, 200, 25) $FLlis = GUICtrlCreateCombo("", 225, 160, 200, 25) $FLliy = GUICtrlCreateInput("", 225, 200, 200, 25) $FLlit = GUICtrlCreateCombo("", 225, 240, 200, 25) $FLdot = GUICtrlCreateDate("", 225, 280, 200, 25, $DTS_SHORTDATEFORMAT) $FLoca = GUICtrlCreateInput("", 225, 320, 200, 25) $FLnic = GUICtrlCreateInput("", 225, 360, 200, 25) $FLlki = GUICtrlCreateInput("", 225, 400, 200, 25) $FLlka = GUICtrlCreateInput("", 225, 440, 200, 25) $FLnoa = GUICtrlCreateInput("", 225, 480, 200, 25) $FLmis = GUICtrlCreateInput("", 225, 520, 200, 150) $FLdor = GUICtrlCreateDate("", 675, 80, 200, 25, $DTS_SHORTDATEFORMAT) $FLofc = GUICtrlCreateInput("", 675, 120, 200, 25) $FLdoe = GUICtrlCreateDate("", 675, 160, 200, 25, $DTS_SHORTDATEFORMAT) $FLop1 = GUICtrlCreateInput("", 675, 200, 200, 25) $FLdo2 = GUICtrlCreateDate("", 675, 240, 200, 25, $DTS_SHORTDATEFORMAT) $FLop2 = GUICtrlCreateInput("", 675, 280, 200, 25) $FLdom = GUICtrlCreateDate("", 675, 320, 200, 25, $DTS_SHORTDATEFORMAT) $FLop3 = GUICtrlCreateInput("", 675, 360, 200, 25) $FLdoc = GUICtrlCreateDate("", 675, 400, 200, 25, $DTS_SHORTDATEFORMAT) $FLop4 = GUICtrlCreateInput("", 675, 440, 200, 25) Local $mke Local $ori Local $lic Local $lis Local $liy Local $lit Local $dot Local $oca Local $lki Local $lka Local $noa Local $mis Local $nic Local $dor Local $ofc Local $doe Local $op1 Local $do2 Local $op2 Local $dom Local $op3 Local $doc Local $op4 ;Fill the Combo Box data GUICtrlSetData($FLlis, $stateList) GUICtrlSetData($FLlit, $ptList) GUICtrlSetData($FLmke, $catList) Local $oFileName = "StolenPlate" Local $aInputVal[23] = [$mke, $ori, $lic, $lis, $liy, $lit, $dot, $oca, $lki, $lka, $noa, $mis, $nic, $dor, $ofc, $doe, $op1, $do2, $op2, $dom, $op3, $doc, $op4] Local $aInputLoc[23] = ["C3","C5","C7","C9","C11","C13","C15","F3","F5","F7","F9","F11","F13","C21","F21","C22","F22","C23","F23","C24","F24","C25","F25"] ;Button 1 GUICtrlCreateButton("REJIS Entry", 1390, 760, 100, 30) GUICtrlSetOnEvent(-1, 'PlateToRejis') ;Button 2 GUICtrlCreateButton("Print Preview", 1390, 800, 100, 30) ;GUICtrlSetOnEvent(-1, "TempForm") Func TempForm($oFileName, $aInpulVal, $aInputLoc) ;**************************************************************************** ; CREATE TEM FORM FROM CALLED DEFAULT FORM, RENAME, AND SAVE ;**************************************************************************** Local $oTempFile = $oFileName&@ComputerName&@MDAY&@HOUR&@MIN&@SEC ;Create application object and open example workbook Local $oAppl = _Excel_Open(False) ;If @error Then Exit MsgBox($MB_SYSTEMMODAL, "Excel UDF: _Excel_BookSaveAs Example", "Error creating the Excel application object.", & @CRLF & "@error = " & @error & ", @extended = " & @extended) Local $oWorkbook = _Excel_BookOpen($oAppl, @ScriptDir & "\"&$oFileName&".xlsx") If @error Then MsgBox($MB_SYSTEMMODAL, "Excel UDF: _Excel_BookSaveAs Example", "Error opening workbook '" & @ScriptDir & "\Forms\"&$oFileName&".xls'." & @CRLF & "@error = " & @error & ", @extended = " & @extended) _Excel_Close($oAppl) Exit EndIf ;**************************************************************************** ; SAVE THE WORKBOOK (xlsx) TO ANOTHER DIRECTORY AND OPEN ;**************************************************************************** Local $sWorkbook = @ScriptDir&"\archive\"&$oTempFile&".xlsx" _Excel_BookSaveAs($oWorkbook, $sWorkbook) If @error Then Exit MsgBox($MB_SYSTEMMODAL, "Excel UDF: _Excel_BookSaveAs Example 1", "Error saving workbook to '" & $sWorkbook & "'." & @CRLF & "@error = " & @error & ", @extended = " & @extended) _Excel_BookClose($oWorkBook) OpnWrt($oTempFile,$aInputVal,$aInputLoc) EndFunc Func OpnWrt($oFileName, $aInputVal, $aInputLoc) ; Create application object and open example workbook Local $oAppl = _Excel_Open() If @error Then Exit MsgBox($MB_SYSTEMMODAL, "Excel UDF: _Excel_BookSaveAs Example", "Error creating the Excel application object." & @CRLF & "@error = " & @error & ", @extended = " & @extended) Local $oWorkbook = _Excel_BookOpen($oAppl, @ScriptDir & "\archive\"&$oFileName&".xlsx") If @error Then MsgBox($MB_SYSTEMMODAL, "Open Temp Doc", "Error opening workbook '" & @ScriptDir & "\Forms\"&$oFileName&".xlsx'." & @CRLF & "@error = " & @error & ", @extended = " & @extended) _Excel_Close($oAppl) Exit EndIf ;**************************************************************************** ; WRITE DATA FROM GUI TO TEMP EXCEL DOC ;**************************************************************************** For $a = 0 to UBound($aInputVal) -1 _Excel_RangeWrite($oWorkbook, $oWorkbook.Activesheet, $aInputVal[$a], $aInputLoc[$a]) Next If @error Then Exit MsgBox($MB_SYSTEMMODAL, "Excel UDF: _Excel_RangeWrite Example 3", "Error writing to worksheet." & @CRLF & "@error = " & @error & ", @extended = " & @extended) _Excel_BookSave($oWorkBook) $oAppl = _Excel_Open() EndFunc Func PlateToRejis() Local $mke = GUICtrlRead($FLmke) Local $ori = GUICtrlRead($FLori) Local $lic = GUICtrlRead($FLlic) Local $lis = GUICtrlRead($FLlis) Local $liy = GUICtrlRead($FLliy) Local $lit = GUICtrlRead($FLlit) Local $dot = GUICtrlRead($FLdot) Local $oca = GUICtrlRead($FLoca) Local $nic = GUICtrlRead($FLnic) Local $lki = GUICtrlRead($FLlki) Local $lka = GUICtrlRead($FLlka) Local $noa = GUICtrlRead($FLnoa) Local $mis = GUICtrlRead($FLmis) Local $dor = GUICtrlRead($FLdor) Local $doe = GUICtrlRead($FLdoe) Local $op1 = GUICtrlRead($FLop1) Local $do2 = GUICtrlRead($FLdo2) Local $op2 = GUICtrlRead($FLop2) Local $dom = GUICtrlRead($FLdom) Local $op3 = GUICtrlRead($FLop3) Local $doc = GUICtrlRead($FLdoc) Local $op4 = GUICtrlRead($FLop4) If WinActivate("REJIS - HOME") = 0 Then MsgBox(0, "Error", "The REJIS Home Window is not open, please re-open it and re-submit the query") ;Exit EndIf WinActivate("REJIS - HOME") Local $oIE = _IEAttach("REJIS - HOME") Local $oIE_Frame = _IEFrameGetObjByName($oIE, "MENUFRAME") Local $oForm = _IEFormGetCollection($oIE_Frame, 0) Local $oSelect = _IEFormElementGetObjByName($oForm, "pages") _IEFormElementOptionSelect($oSelect, "Vehicle Enter Stolen License", 1, "byText") Sleep(2000) Local $oIE2 = _IEAttach("REJIS - Vehicle Enter Stolen License") Local $oIEFrame2 = _IEFrameGetObjByName($oIE2, "MAIN") Local $oIE_Frame2 = _IEFrameGetObjByName($oIEFrame2, "TOP") Local $oForm2 = _IEGetObjByName($oIE_Frame2, "inquiry") Local $oOri = _IEGetObjByName($oForm2, "ori") Local $oMke = _IEGetObjByName($oForm2, "category") Local $oLic = _IEGetObjByName($oForm2, "lic") Local $oLis = _IEGetObjByName($oForm2, "lic_state") Local $oLiy = _IEGetObjByName($oForm2, "lic_year") Local $oLit = _IEGetObjByName($oForm2, "veh_lic_type") Local $oDot1 = _IEGetObjByName($oForm2, "report_date_mm") Local $oDot2 = _IEGetObjByName($oForm2, "report_date_dd") Local $oDot3 = _IEGetObjByName($oForm2, "report_date_yy") Local $oComp1 = _IEGetObjByName($oForm2, "comp1") Local $oComp2 = _IEGetObjByName($oForm2, "comp2") Local $oMis = _IEGetObjByName($oForm2, "ncic_misc") Local $RptDate = StringSplit($dot,"/",0) _IEFormElementSetValue($oOri, $ori) _IEFormElementOptionSelect($oMke, $mke, 1, "byText") _IEFormElementSetValue($oLic, $lic) _IEFormElementOptionSelect($oLis, $lis, 1, "byText") _IEFormElementSetValue($oLiy, $liy) _IEFormElementOptionSelect($oLit, $lit, 1, "byText") _IEFormElementSetValue($oDot1, $RptDate[1]) _IEFormElementSetValue($oDot2, $RptDate[2]) _IEFormElementSetValue($oDot3, $RptDate[3]) _IEFormElementSetValue($oComp1, StringLeft($oca, 2)) _IEFormElementSetValue($oComp2, StringRight($oca, 6)) _IEFormElementSetValue($oMis, $mis) EndFunc GUISetState(@SW_SHOW) ;OnEvent mode While 1 Sleep(500) WEnd Func GUIExit() Exit EndFunc That's the whole of it and where I'm running into the headache is Button 2 The print preview button. I get an error is I take out the comment in front of the GUICtrlSetOnEvent and I understand that, but it sounds like I should just take those parameters out of TempForm and just call it as is. (If I am understanding this correctly)
-
#include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <EditConstants.au3> #include <WindowsConstants.au3> #include <DateTimeConstants.au3> #include <IE.au3> #include <InetConstants.au3> #include <StringConstants.au3> #include <FileConstants.au3> #include <Excel.au3> #include <MsgBoxConstants.au3> Opt('GUIOnEventMode', 1) GUICreate("JCSO NCIC Entry", 1500, 900) GUISetOnEvent($GUI_EVENT_CLOSE, 'GUIExit') Global $sFont = "Calibri" ;LICENSE VARIABLES Global $FLmke Global $FLori Global $FLlic Global $FLlis Global $FLliy Global $FLlit Global $FLdot Global $FLoca Global $FLnic Global $FLlki Global $FLlka Global $FLnoa Global $FLmis Global $FLdor Global $FLofc Global $FLdoe Global $FLop1 Global $FLdo2 Global $FLop2 Global $FLdom Global $FLop3 Global $FLdoc Global $FLop4 ;Menu Creation Local $filemenu = GUICtrlCreateMenu("&File") Local $helpmenu = GUICtrlCreateMenu("?") Local $openItem = GUICtrlCreateMenuItem("&Open", $filemenu) Local $saveItem = GUICtrlCreateMenuItem("&Save", $filemenu) Local $infoItem = GUICtrlCreateMenuItem("Info", $helpmenu) Local $exitItem = GUICtrlCreateMenuItem("E&xit", $filemenu) ;Tab Creation GUICtrlCreateTab(0,0,1500,880) ;Create the License Plate Tab GUICtrlCreateTabItem("License Plate") ;Create the form labels GUICtrlCreateLabel("Message Key (MKE)", 20, 40, 200, 75) GUICtrlSetFont(-1, 10, 700, 1, $sFont, 5) GUICtrlCreateLabel("Originating Agency (ORI)", 20, 80, 200, 75) GUICtrlSetFont(-1, 10, 700, 1, $sFont, 5) GUICtrlCreateLabel("License Plate No. (LIC)", 20, 120, 200, 75) GUICtrlSetFont(-1, 10, 700, 1, $sFont, 5) GUICtrlCreateLabel("License Plate St. (LIS)", 20, 160, 200, 75) GUICtrlSetFont(-1, 10, 700, 1, $sFont, 5) GUICtrlCreateLabel("Expiration Year (LIY)", 20, 200, 200, 75) GUICtrlSetFont(-1, 10, 700, 1, $sFont, 5) GUICtrlCreateLabel("License Plate Type (LIT)", 20, 240, 200, 75) GUICtrlSetFont(-1, 10, 700, 1, $sFont, 5) GUICtrlCreateLabel("Date of Theft (DOT)", 20, 280, 200, 75) GUICtrlSetFont(-1, 10, 700, 1, $sFont, 5) GUICtrlCreateLabel("Case Number (OCA)", 20, 320, 200, 75) GUICtrlSetFont(-1, 10, 700, 1, $sFont, 5) GUICtrlCreateLabel("NCIC Number (NIC)", 20, 360, 200, 75) GUICtrlSetFont(-1, 10, 700, 1, $sFont, 5) GUICtrlCreateLabel("Linking Agency Id (LKI)", 20, 400, 200, 75) GUICtrlSetFont(-1, 10, 700, 1, $sFont, 5) GUICtrlCreateLabel("Linking Case Number (LKA)", 20, 440, 200, 75) GUICtrlSetFont(-1, 10, 700, 1, $sFont, 5) GUICtrlCreateLabel("Notify Originating Agency (NOA)", 20, 480, 200, 75) GUICtrlSetFont(-1, 10, 700, 1, $sFont, 5) GUICtrlCreateLabel("Miscellaneous Info (MIS)", 20, 520, 200, 75) GUICtrlSetFont(-1, 10, 700, 1, $sFont, 5) GUICtrlCreateLabel("ENTRY & SECOND PARTY CHECK", 550, 40, 200, 75) GUICtrlSetFont(-1, 10, 700, 6, $sFont, 5) GUICtrlCreateLabel("", 500, 60, 200, 75) GUICtrlCreateLabel("Date Received", 500, 80, 200, 75) GUICtrlSetFont(-1, 10, 700, 1, $sFont, 5) GUICtrlCreateLabel("Date of Entry", 500, 160, 200, 75) GUICtrlSetFont(-1, 10, 700, 1, $sFont, 5) GUICtrlCreateLabel("Date of Second Party Check", 500, 240, 200, 75) GUICtrlSetFont(-1, 10, 700, 1, $sFont, 5) GUICtrlCreateLabel("Modify Date", 500, 320, 200, 75) GUICtrlSetFont(-1, 10, 700, 1, $sFont, 5) GUICtrlCreateLabel("Clear, Cancel, or Locate Date", 500, 400, 200, 75) GUICtrlSetFont(-1, 10, 700, 1, $sFont, 5) GUICtrlCreateLabel("Officer/Agency", 500, 120, 200, 75) GUICtrlSetFont(-1, 10, 700, 1, $sFont, 5) GUICtrlCreateLabel("Operator", 500, 200, 200, 75) GUICtrlSetFont(-1, 10, 700, 1, $sFont, 5) GUICtrlCreateLabel("Operator", 500, 280, 200, 75) GUICtrlSetFont(-1, 10, 700, 1, $sFont, 5) GUICtrlCreateLabel("Operator", 500, 360, 200, 75) GUICtrlSetFont(-1, 10, 700, 1, $sFont, 5) GUICtrlCreateLabel("Operator", 500, 440, 200, 75) GUICtrlSetFont(-1, 10, 700, 1, $sFont, 5) ;Create the Input parameters $FLmke = GUICtrlCreateCombo("", 225, 40, 200, 25) $FLori = GUICtrlCreateInput("", 225, 80, 200, 25) $FLlic = GUICtrlCreateInput("", 225, 120, 200, 25) $FLlis = GUICtrlCreateCombo("", 225, 160, 200, 25) $FLliy = GUICtrlCreateInput("", 225, 200, 200, 25) $FLlit = GUICtrlCreateCombo("", 225, 240, 200, 25) $FLdot = GUICtrlCreateDate("", 225, 280, 200, 25, $DTS_SHORTDATEFORMAT) $FLoca = GUICtrlCreateInput("", 225, 320, 200, 25) $FLnic = GUICtrlCreateInput("", 225, 360, 200, 25) $FLlki = GUICtrlCreateInput("", 225, 400, 200, 25) $FLlka = GUICtrlCreateInput("", 225, 440, 200, 25) $FLnoa = GUICtrlCreateInput("", 225, 480, 200, 25) $FLmis = GUICtrlCreateInput("", 225, 520, 200, 150) $FLdor = GUICtrlCreateDate("", 675, 80, 200, 25, $DTS_SHORTDATEFORMAT) $FLofc = GUICtrlCreateInput("", 675, 120, 200, 25) $FLdoe = GUICtrlCreateDate("", 675, 160, 200, 25, $DTS_SHORTDATEFORMAT) $FLop1 = GUICtrlCreateInput("", 675, 200, 200, 25) $FLdo2 = GUICtrlCreateDate("", 675, 240, 200, 25, $DTS_SHORTDATEFORMAT) $FLop2 = GUICtrlCreateInput("", 675, 280, 200, 25) $FLdom = GUICtrlCreateDate("", 675, 320, 200, 25, $DTS_SHORTDATEFORMAT) $FLop3 = GUICtrlCreateInput("", 675, 360, 200, 25) $FLdoc = GUICtrlCreateDate("", 675, 400, 200, 25, $DTS_SHORTDATEFORMAT) $FLop4 = GUICtrlCreateInput("", 675, 440, 200, 25) Local $mke Local $ori Local $lic Local $lis Local $liy Local $lit Local $dot Local $oca Local $lki Local $lka Local $noa Local $mis Local $nic Local $dor Local $ofc Local $doe Local $op1 Local $do2 Local $op2 Local $dom Local $op3 Local $doc Local $op4 ;Fill the Combo Box data GUICtrlSetData($FLlis, $stateList) GUICtrlSetData($FLlit, $ptList) GUICtrlSetData($FLmke, $catList) Local $oFileName = "StolenPlate" Local $aInputVal[23] = [$mke, $ori, $lic, $lis, $liy, $lit, $dot, $oca, $lki, $lka, $noa, $mis, $nic, $dor, $ofc, $doe, $op1, $do2, $op2, $dom, $op3, $doc, $op4] Local $aInputLoc[23] = ["C3","C5","C7","C9","C11","C13","C15","F3","F5","F7","F9","F11","F13","C21","F21","C22","F22","C23","F23","C24","F24","C25","F25"] ;Button 1 GUICtrlCreateButton("REJIS Entry", 1390, 760, 100, 30) GUICtrlSetOnEvent(-1, 'PlateToRejis') ;Button 2 GUICtrlCreateButton("Print Preview", 1390, 800, 100, 30) ;GUICtrlSetOnEvent(-1, "TempForm") Func TempForm($oFileName, $aInpulVal, $aInputLoc) ;**************************************************************************** ; CREATE TEM FORM FROM CALLED DEFAULT FORM, RENAME, AND SAVE ;**************************************************************************** Local $oTempFile = $oFileName&@ComputerName&@MDAY&@HOUR&@MIN&@SEC ;Create application object and open example workbook Local $oAppl = _Excel_Open(False) ;If @error Then Exit MsgBox($MB_SYSTEMMODAL, "Excel UDF: _Excel_BookSaveAs Example", "Error creating the Excel application object.", & @CRLF & "@error = " & @error & ", @extended = " & @extended) Local $oWorkbook = _Excel_BookOpen($oAppl, @ScriptDir & "\"&$oFileName&".xlsx") If @error Then MsgBox($MB_SYSTEMMODAL, "Excel UDF: _Excel_BookSaveAs Example", "Error opening workbook '" & @ScriptDir & "\Forms\"&$oFileName&".xls'." & @CRLF & "@error = " & @error & ", @extended = " & @extended) _Excel_Close($oAppl) Exit EndIf ;**************************************************************************** ; SAVE THE WORKBOOK (xlsx) TO ANOTHER DIRECTORY AND OPEN ;**************************************************************************** Local $sWorkbook = @ScriptDir&"\archive\"&$oTempFile&".xlsx" _Excel_BookSaveAs($oWorkbook, $sWorkbook) If @error Then Exit MsgBox($MB_SYSTEMMODAL, "Excel UDF: _Excel_BookSaveAs Example 1", "Error saving workbook to '" & $sWorkbook & "'." & @CRLF & "@error = " & @error & ", @extended = " & @extended) _Excel_BookClose($oWorkBook) OpnWrt($oTempFile,$aInputVal,$aInputLoc) EndFunc Func OpnWrt($oFileName, $aInputVal, $aInputLoc) ; Create application object and open example workbook Local $oAppl = _Excel_Open() If @error Then Exit MsgBox($MB_SYSTEMMODAL, "Excel UDF: _Excel_BookSaveAs Example", "Error creating the Excel application object." & @CRLF & "@error = " & @error & ", @extended = " & @extended) Local $oWorkbook = _Excel_BookOpen($oAppl, @ScriptDir & "\archive\"&$oFileName&".xlsx") If @error Then MsgBox($MB_SYSTEMMODAL, "Open Temp Doc", "Error opening workbook '" & @ScriptDir & "\Forms\"&$oFileName&".xlsx'." & @CRLF & "@error = " & @error & ", @extended = " & @extended) _Excel_Close($oAppl) Exit EndIf ;**************************************************************************** ; WRITE DATA FROM GUI TO TEMP EXCEL DOC ;**************************************************************************** For $a = 0 to UBound($aInputVal) -1 _Excel_RangeWrite($oWorkbook, $oWorkbook.Activesheet, $aInputVal[$a], $aInputLoc[$a]) Next If @error Then Exit MsgBox($MB_SYSTEMMODAL, "Excel UDF: _Excel_RangeWrite Example 3", "Error writing to worksheet." & @CRLF & "@error = " & @error & ", @extended = " & @extended) _Excel_BookSave($oWorkBook) $oAppl = _Excel_Open() EndFunc Ok, that's a bit long, but it's the shell of the GUI function. The PlateToRejis function works fine so is not included. I've wondered if we even need to put the parameters in the function or just let them get called as they are
-
I'm working on a program with a colleague. He wants to create a function which takes 3 parameters and then loop through two arrays which I think we can do well enough. However, we want this to be attached to a GUI form we've built so when the user clicks a button, it will invoke the function which then takes the local variables as the parameters for the function and executes it. I know that GUICtrlSetOnEvent can't take parameters, but is there a way to get around this and make this work?
-
trdunsworth reacted to a post in a topic: Non-standard naming convention and trying to hit a button
-
trdunsworth reacted to a post in a topic: Non-standard naming convention and trying to hit a button
-
trdunsworth reacted to a post in a topic: Non-standard naming convention and trying to hit a button
-
I started messing around with the first suggestion and got fed up and just did MouseClick inside the button. (Setting the mouse coordinates to inside the IE Window.) I tried the $oIE1.document.querySelector, but I think I did something wrong because it didn't do anything, but exited with 0, so I'm guessing it's programmer error at this stage....
-
I'm working on a program that allows my users to input information in a GUI and then hit a button and write that information two places. So far, for each of the html pages it has to write to, I've had no problems. When it comes to reaching the screen to enter orders of protection, I run into a snag. All of the other pages they need are accessible from a dropdown menu at the top of the page. (I did not write the html I have to access, just as an fyi) However, for this one, I have to click a button on a main frame in the page, which will lead to another page, with another button. However, here's the rub. The button does not have a name, it has a submitName as a custom HTML attribute. <button submitName="Orders Of Protection" style="width: 135px; height: 30px;" onclick="bClicked('submenu.htm?ref=OOPMENU', 'Orders Of Protection')" type="button" oldbackgroundcolor="buttonface" oldtextcolor=""> My code to reach it works. I am using a similar template and in testing a base code, it tells me that there's no match for the submitName attribute, but it doesn't argue with the drill down to reach it. #include <IE.au3> If WinActivate("REJIS - HOME") = 0 Then MsgBox(0, "Error", "The REJIS Home Window is not open. Please re-open it and re-submit the request.") Exit EndIf WinActivate("REJIS - HOME") Local $oIE1 = _IEAttach("REJIS - HOME") Local $oFrame1 = _IEFrameGetObjByName($oIE1, "MAIN") Local $oFrame2 = _IEFrameGetObjByName($oFrame1, "HOMEBOTTOM") Local $oBtn1 = _IEGetObjByName($oFrame2, "Orders of Protection") _IEAction($oBtn1, "click") This is test code only to reach that specific button. The production code is much longer so I am submitting the test. The <button> is embedded in 3 framesets to get to the "MAIN" frame, then 1 frameset to get to the "HOMEBOTTOM" frame, then inside that frame's body tag, it is in a table, 3rd row, 3rd cell in the row. (I don't know if I'm allowed to expose all of the html by contract.) which makes it fun to find and I do not have a name or an id attribute in the buttons, the table or any of the table's descendents. Any ideas on how to find it so I can click it? (Without going to the website authors and asking them to please write better html....)
-
Thank you for that! I hadn't paid attention to my old code and I'd done that in something else I'd written a couple of years ago. In fact, I was just explaining it to someone today, so I get the braindead award for that. It's nice to encounter another brother here. I'm from Independence Lodge #76 in Missouri myself.
-
trdunsworth reacted to a post in a topic: GUICtrlRead mistake
-
I was using it because I thought that I needed it. Clarifying that for me is great. Thanks. Ok, if I'm understanding you correctly, I'm missing another step in the process. I need to fix the value as whatever the user will enter, then read that. That helps me try to think of what to do next. I love the Avatar. If I may ask, what lodge?
-
Ok, I'm sure this is something I'm missing, but I am going to ask so I can get this moving in the right direction. I've created a tabbed form which would take input from a user and write that input to a html form locally and eventually also push that data to another website elsewhere. That part shouldn't be a big deal, but I'm having a problem with GUICtrlRead and it only giving me what I'm guessing is the ID number of the input. Here's abbreviated code for clarity. #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <EditConstants.au3> #include <WindowsConstants.au3> #include <DateTimeConstants.au3> #include <IE.au3> #include <InetConstants.au3> #include <StringConstants.au3> #include <FileConstants.au3> ; Changes to OnEvent Mode Opt('GUIOnEventMode', 1) GuiCreate("JCSO NCIC Entry", 1500, 900) GUISetIcon("icon.ico") Global $sFont = "Calibri" ;Menu Creation Local $filemenu = GUICtrlCreateMenu("&File") Local $helpmenu = GUICtrlCreateMenu("?") Local $openItem = GUICtrlCreateMenuItem("&Open", $filemenu) Local $saveItem = GUICtrlCreateMenuItem("&Save", $filemenu) Local $infoItem = GUICtrlCreateMenuItem("Info", $helpmenu) Local $exitItem = GUICtrlCreateMenuItem("E&xit", $filemenu) ;Tab Creation GUICtrlCreateTab(0,0,1500,880) ;Tab 1 Creation ;================================================== GUICtrlCreateTabItem("License Plate") GUICtrlCreateLabel("Message Key (MKE)", 20, 40, 200, 75) GUICtrlSetFont(-1, 10, 700, 1, $sFont, 5) GUICtrlCreateLabel("Originating Agency (ORI)", 20, 80, 200, 75) GUICtrlSetFont(-1, 10, 700, 1, $sFont, 5) GUICtrlCreateLabel("License Plate No. (LIC)", 20, 120, 200, 75) GUICtrlSetFont(-1, 10, 700, 1, $sFont, 5) GUICtrlCreateLabel("License Plate St. (LIS)", 20, 160, 200, 75) GUICtrlSetFont(-1, 10, 700, 1, $sFont, 5) GUICtrlCreateLabel("Expiration Year (LIY)", 20, 200, 200, 75) GUICtrlSetFont(-1, 10, 700, 1, $sFont, 5) GUICtrlCreateLabel("License Plate Type (LIT)", 20, 240, 200, 75) GUICtrlSetFont(-1, 10, 700, 1, $sFont, 5) GUICtrlCreateLabel("Date of Theft (DOT)", 20, 280, 200, 75) GUICtrlSetFont(-1, 10, 700, 1, $sFont, 5) GUICtrlCreateLabel("Case Number (OCA)", 20, 320, 200, 75) GUICtrlSetFont(-1, 10, 700, 1, $sFont, 5) GUICtrlCreateLabel("NCIC Number (NIC)", 20, 360, 200, 75) GUICtrlSetFont(-1, 10, 700, 1, $sFont, 5) GUICtrlCreateLabel("Linking Agency Id (LKI)", 20, 400, 200, 75) GUICtrlSetFont(-1, 10, 700, 1, $sFont, 5) GUICtrlCreateLabel("Linking Case Number (LKA)", 20, 440, 200, 75) GUICtrlSetFont(-1, 10, 700, 1, $sFont, 5) GUICtrlCreateLabel("Notify Originating Agency (NOA)", 20, 480, 200, 75) GUICtrlSetFont(-1, 10, 700, 1, $sFont, 5) GUICtrlCreateLabel("Miscellaneous Info (MIS)", 20, 520, 200, 75) GUICtrlSetFont(-1, 10, 700, 1, $sFont, 5) Local $Fmke = GUICtrlCreateInput("", 225, 40, 200, 25) Local $mke = GUICtrlRead($Fmke, 1) Local $Fori = GUICtrlCreateInput("", 225, 80, 200, 25) Local $Flic = GUICtrlCreateInput("", 225, 120, 200, 25) Local $Flis = GUICtrlCreateCombo("", 225, 160, 200, 25) Local $Fliy = GUICtrlCreateInput("", 225, 200, 200, 25) Local $Flit = GUICtrlCreateCombo("", 225, 240, 200, 25) Local $Fdot = GUICtrlCreateDate("", 225, 280, 200, 25, $DTS_SHORTDATEFORMAT) Local $Foca = GUICtrlCreateInput("", 225, 320, 200, 25) Local $Fnic = GUICtrlCreateInput("", 225, 360, 200, 25) Local $Flki = GUICtrlCreateInput("", 225, 400, 200, 25) Local $Flka = GUICtrlCreateInput("", 225, 440, 200, 25) Local $Fnoa = GUICtrlCreateInput("", 225, 480, 200, 25) Local $Fmis = GUICtrlCreateInput("", 225, 520, 200, 150) Local $secondLabel = GUICtrlCreateLabel("ENTRY & SECOND PARTY CHECK", 550, 40, 200, 75) GUICtrlSetFont($secondLabel, 10, 700, 6, "Calibri", 5) GUICtrlCreateLabel("", 500, 60, 200, 75) GUICtrlCreateLabel("Date Received", 500, 80, 200, 75) GUICtrlSetFont(-1, 10, 700, 1, $sFont, 5) GUICtrlCreateLabel("Date of Entry", 500, 160, 200, 75) GUICtrlSetFont(-1, 10, 700, 1, $sFont, 5) GUICtrlCreateLabel("Date of Second Party Check", 500, 240, 200, 75) GUICtrlSetFont(-1, 10, 700, 1, $sFont, 5) GUICtrlCreateLabel("Modify Date", 500, 320, 200, 75) GUICtrlSetFont(-1, 10, 700, 1, $sFont, 5) GUICtrlCreateLabel("Clear, Cancel, or Locate Date", 500, 400, 200, 75) GUICtrlSetFont(-1, 10, 700, 1, $sFont, 5) GUICtrlCreateLabel("Officer/Agency", 500, 120, 200, 75) GUICtrlSetFont(-1, 10, 700, 1, $sFont, 5) GUICtrlCreateLabel("Operator", 500, 200, 200, 75) GUICtrlSetFont(-1, 10, 700, 1, $sFont, 5) GUICtrlCreateLabel("Operator", 500, 280, 200, 75) GUICtrlSetFont(-1, 10, 700, 1, $sFont, 5) GUICtrlCreateLabel("Operator", 500, 360, 200, 75) GUICtrlSetFont(-1, 10, 700, 1, $sFont, 5) GUICtrlCreateLabel("Operator", 500, 440, 200, 75) GUICtrlSetFont(-1, 10, 700, 1, $sFont, 5) Local $FdateRecd = GUICtrlCreateDate("", 675, 80, 200, 25, $DTS_SHORTDATEFORMAT) Local $Fofc = GUICtrlCreateInput("", 675, 120, 200, 25) Local $Fdoe = GUICtrlCreateDate("", 675, 160, 200, 25, $DTS_SHORTDATEFORMAT) Local $Fop1 = GUICtrlCreateInput("", 675, 200, 200, 25) Local $Fdo2 = GUICtrlCreateDate("", 675, 240, 200, 25, $DTS_SHORTDATEFORMAT) Local $Fop2 = GUICtrlCreateInput("", 675, 280, 200, 25) Local $Fdom = GUICtrlCreateDate("", 675, 320, 200, 25, $DTS_SHORTDATEFORMAT) Local $Fop3 = GUICtrlCreateInput("", 675, 360, 200, 25) Local $Fdoc = GUICtrlCreateDate("", 675, 400, 200, 25, $DTS_SHORTDATEFORMAT) Local $Fop4 = GUICtrlCreateInput("", 675, 440, 200, 25) ;Button 1 GUICtrlCreateButton("REJIS Entry", 1390, 760, 100, 30) GUICtrlSetOnEvent(-1, 'Function1a') ;Button 2 GUICtrlCreateButton("Print Preview", 1390, 800, 100, 30) GUICtrlSetOnEvent(-1, 'Function2a') ;Button 3 GUICtrlCreateButton("Print Form", 1390, 840, 100, 30) GUICtrlSetOnEvent(-1, 'Function3a') Func Function2a() ;Hides the GUI while the function is running ;GUISetState(@SW_HIDE) Local $oIE = _IECreate("http://jcsoarch:8099/licensePlate.html") Local $oForm = _IEFormGetObjByName($oIE, "licensePlate") Local $oMke = _IEFormElementGetObjByName($oForm, "mke") _IEFormElementSetValue($oMke, $mke) EndFunc If I put anything in the First input box, when I hit Print Preview, it opens the form nicely and inserts 83 in the first text box, rather than anything I've actually put in that field. I know it has to be simple to get, but it's evading me right now. Pointing me in the right direction is most appreciated, thanks in advance.
-
Scrape a web form and fill a pdf form
trdunsworth replied to trdunsworth's topic in AutoIt General Help and Support
I certainly like the look for that library and I will go through and give it a read to see what I can do with it! Thank you for your assistance!!!! -
trdunsworth reacted to a post in a topic: Scrape a web form and fill a pdf form
-
Ok, I admit, I don't use AutoIt as much as I should. I've built scripts that scrape a command line input and feed it into a webpage, but now I have to go backwards to a degree. I need to take the information that is entered into a form on the web page and then insert it into a pdf form in Acrobat Reader. I can do the normal stuff, open the file and open the correct form, then have the user save it and print it. Those won't be a problem. The issue is the scraping from IE to AcroReader. I will know the form field names on both sides, so I think this should be relatively simple, but I want to ensure I'm going the right direction. If I'm right, should it be similar to the _IEFormElementSetValue? (Just with something else which goes into Acrobat Reader?) Thanks in advance for any help pointing me in the right direction. Cheers, Tony
-
Trying to click a button
trdunsworth replied to trdunsworth's topic in AutoIt General Help and Support
We ended up doing it this way $oIE2=_IEAttach("REJIS - NCIC Property - Guns") $o_IE2Frame=_IEFrameGetObjByName($oIE2,"MAIN") $oButtons=_IETagNameGetCollection($o_IE2Frame,"button") For $oButton in $oButtons Switch $oButton.name Case "Gun Inquiry" $o_BtnGunInquiry=$oButton EndSwitch Next _IEAction($o_BtnGunInquiry,"click") However, I'm going to test yours as well because if it works the way I think it should, I like the shorter code. Thanks agian for the help!! -
Trying to click a button
trdunsworth replied to trdunsworth's topic in AutoIt General Help and Support
Thanks for the information and advice. We found a way to work with it and get it working, so now we're just polishing things up. I'm going to keep plugging away and thanks again for your help!!!! -
Good day folks, I'm trying to write a script which will open a page, go down to the right table, and click the only button which is in that table. (I didn't write the site, I just have to work with it. I can get to the page just fine and I'm certain I've drilled into the right table. I just can't click the bloody button. The HTML code for that table and it is the 6th table on the page (so I'm aiming, when I post my script code for index 5) <table> <tbody> <tr> </td/> <td> <button style="width: 135px; height: 30px;" onclick="bClicked('Mules_Inq/mules_prop_gun_inq_frame.htm', 'Gun Inquiry')" type="button"> </td> <td /> </tr> </tbody> </table> My script code so far: #include <IE.au3> AutoItSetOption("WinTitleMatchMode",2) $winhandle=WinActivate("REJIS - ") $oIE=_IEAttach("REJIS") $o_IEFrame=_IEFrameGetObjByName($oIE,"MENUFRAME") $o_form=_IEFormGetCollection($o_IEFrame,0) $o_pages=_IEFormElementGetObjByName($o_form,"pages") ;_IEFormElementOptionSelect($o_pages,"Address Inquiry",1,"byText") _IEFormElementOptionSelect($o_pages,"NCIC Property - Guns",1,"byText") $oIE2=_IEAttach("REJIS - NCIC Property - Guns") $o_IE2Frame=_IEFrameGetObjByName($oIE2,"MAIN") $o_table=_IETableGetCollection($o_IE2Frame,5) $o_inquiry=_IEGetObjByName($o_table, "Gun Inquiry") _IEAction($o_inquiry,"click") This allows me to get to the page, but the button isn't being clicked. I know I'm new at this, so I'm hoping I can get pointed to the right direction to fix this issue. Thanks, Tony