Jump to content

Search the Community

Showing results for tags 'Form'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


  • 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


  • 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

Find results in...

Find results that contain...

Date Created

  • Start


Last Updated

  • Start


Filter by number of...


  • Start



Member Title




Found 21 results

  1. Taking the idea from @Melba23's (btw, thanks ) ExtMsgBox and also making use of his StringSize UDF, I made a extended version of the InputBox function. From the README file: This UDF creates input boxes (just like native InputBox), but with multiple inputs. You can also set some inputs to be password-style, set the default texts for some of the edits and even set the label of the OK/cancel buttons. How to use _ExtInputBox($sTitle, $sTexts [ , $sDefaults = Null [ , $sPasswords = Null [ , $sBtnLabels = "OK|Cancel" [ , $iWidth = -1 [ , $iLeft = -1 [ , $iTop = -1 [ , $iTimeout = 0 [ , $hParent = 0 ] ] ] ] ] ] ] ] ) Arguments are: $sTitle (mandatory): The window title (e.g.: "Hello World") $sTexts (mandatory): The edit labels, separated by | (e.g.: "Your email|Your password") $sDefaults: The default input texts, separated by | (e.g.: "|you@us.com||" will tell that the first input will have nothing as default text, the second will have you@us.com as default text and the third and forth will also have nothing). Note that if you set the default value of 1 input, you must set the value of them all (even if it's nothing), otherwise all inputs will have no default value. Default is none. $sPasswords: One or more 1-based index of inputs, separated by anything that is not a number (pipeline - | - recommended), of the inputs that will receive password style (e.g.: "2|3" wíll tell that the second and third inputs are password-style, default is none) $sBtnLabels: The TWO label of the default OK/Cancel buttons (e.g.: "Submit|Close") $iWidth: Window width (default is the size of the longest string with the limit of 25% of the screen width). Obviously it's not possible to set the height as it's calculated automatically. $iLeft: Distance of the window from the left side of the screen (default is centered) $iTop: Distance of the window to the top of the screen (default is centered) $iTimeout: Time limit for filling the form data (default is none) $hParent: Parent form (default is none) Return value Sucess: an 1-based array with the input values entered ($aArray[1] = 1st input value, $aArray[2] = 2nd input value, $aArray[n] = nth input value, whereas $aArray[0] = input count) Failure: False, and set @extended to 1 if the user clicked cancel, 2 if the user closed the window, or 3 if timeout ended. Examples (two of them) #include 'ExtInputBox.au3' $sData = _ExtInputBox("Login", "Username|Password", Null, "2") If $sData = False Then MsgBox(0, "", "You pressed cancel, exit or timeout ended.") Else MsgBox(0, "You entered:", "Username: " & $sData[1] & @CRLF & "Password: " & $sData[2]) EndIf #include 'ExtInputBox.au3' $sData = _ExtInputBox("Login", "Your full name|Your email|Your telephone|Choose an username|Choose a password|Repeat password", "Mr./Ms. ||+1 |admin||", "5,6", "Register|Cancel") If $sData = False Then Switch @extended Case 1 MsgBox(0, "", "You clicked Cancel") Case 2 MsgBox(0, "", "You closed the window.") Case 3 MsgBox(0, "", "Timeout ended (but we have no timeout on this example, so this will never happen)") EndSwitch Else MsgBox(0, "You entered:", "Full name: " & $sData[1] & @CRLF & _ "Email: " & $sData[2] & @CRLF & _ "Telephone:" & $sData[3] & @CRLF & _ "Username: " & $sData[4] & @CRLF & _ "Password: " & $sData[5] & @CRLF & _ "Password repeat: " & $sData[6]) EndIf Download Download ZIP from GitHub Btw, fork me on Github
  2. I am starting out using AutoIt. Here is a simple form with username and password. I want to check if information entered is valid once user clicks a button. My problem now is that it only validates once. E.g.: if I type 5 character username, it will complain it is not 7 character (good). But once I correct that mistake and press the button again it will still say the same thing. Do I need to have a loop? #include <GUIConstantsEx.au3> #include <EditConstants.au3> #include <MsgBoxConstants.au3> Opt("GUIOnEventMode", 1) $main = GUICreate("Test Tool", 600, 600) $hyourlabel = GUICtrlCreateLabel("YOUR CREDENTIALS", 30, 10, 256) GUICtrlSetFont($hyourlabel, Default, 600) Local $adminfrejalabel = GUICtrlCreateLabel("Username:", 8, 38, 64, 17) Global $adminfrejaid = GUICtrlCreateInput("", 80, 38, 110, 17) Local $adminpasswordlabel = GUICtrlCreateLabel("Password:", 8, 62, 64, 17) Global $adminpassword = GUICtrlCreateInput("", 80, 62, 110, 17, BitOR($ES_PASSWORD, $ES_AUTOHSCROLL)) $userButton_Check = GUICtrlCreateButton("VALIDATE", 32, 480, 85, 25) GUICtrlSetOnEvent($userButton_Check, "startvalidation") GUISetOnEvent($GUI_EVENT_CLOSE, "ExitGUI") GUISetState(@SW_SHOW) While 1 Sleep(10) WEnd Func startvalidation() ;CHECK VALIDATIONS $adminfrejaid = GUICtrlRead($adminfrejaid) $adminpassword = GUICtrlRead($adminpassword) If StringLen($adminfrejaid) <> '7' Then MsgBox($MB_SYSTEMMODAL, "User ID", "Please enter exactly 7 characters.") ;Exit EndIf If StringLen($adminpassword) < '5' Then MsgBox($MB_SYSTEMMODAL, "Your Password", "Please enter a valid password.") ;Exit EndIf EndFunc Func ExitGui () Exit ; Exit the program EndFunc
  3. Hello. I'm working on converting another script from IE to Firefox. I can't seem to get a handle on the field "Defendant" to fill in a last, first name on this page: http://www.hcdistrictclerk.com/Edocs/Public/Search.aspx?Tab=tabCriminal I also can't seem to submit the form. I've tried the code below... stuff may be commented out that I have tested. _FFOpenUrl("http://www.hcdistrictclerk.com/Edocs/Public/Search.aspx?Tab=tabCriminal") _FFLoadWait() $oTextFN = _FSObjGet("ctl00_ctl00_ctl00_ContentPlaceHolder1_ContentPlaceHolder2_ContentPlaceHolder2_tabSearch_tabCriminal_txtCrimDefendant", "ID") _FFObj($oTextFN, "value", "Smith, John") $subButton = _FFObjGet("ctl00$ctl00$ctl00$ContentPlaceHolder1$ContentPlaceHolder2$ContentPlaceHolder2$btnSearch", "name") _FFClick($subButton) _FFLoadWait() ; _FFFormSubmit() ; _FFLoadWait() Any help from the experts on here would be greatly appreciated. Jason
  4. Hello everyone, I'm trying to pass values to elements in a website. The elements are present within a table, which is again present within a table, which is inside a form. I tried to read the form, tables, etc., but with no results. It appears to me that the elements, tables, form, etc., were not read at all. The following is what I tried. Please guide me. ;I tried the following to read the tables into arrays #include <IE.au3> #include <MsgBoxConstants.au3> Local $oIE = _IECreate() _IENavigate($oIE, "---- URL HERE ----") _IELoadWait($oIE) $o_Table = _IETableGetCollection ($oIE) $i_NumTables = @extended For $i = 0 To $i_NumTables - 1 Step 1 $o_Table_Temp2 = _IETableGetCollection ($oIE, $i) $a_TableData = _IETableWriteToArray ($o_Table_Temp2) _ArrayDisplay($a_TableData) Next ;I tried the following code to pass value to the field #include <IE.au3> #include <MsgBoxConstants.au3> Local $oIE = _IECreate() _IENavigate($oIE, "---- URL HERE ----", 0) _IELoadWait($oIE) Local $oForm = _IEFormGetObjByName($oIE, "default") Local $oField = _IEFormElementGetObjByName($oForm, "tGroup") _IEFormElementSetValue($oField, "---- VALUE HERE ----") The following is the html view of the website and the highlighted field is the one that I want to pass values to. Since this is an official website, I can't share the exact url.
  5. Good evening guys ( almost good night here in Italy ) How are you? Hop you're fine I'm trying to do a Login Form ( I did, but I'm missing something in the management ), that allows the user to login when the script is launched, and, when the main GUI is opened, the user can Logout and Login with another username and password. The username and password "checking" I do is done by a text file, which in there are username and password, crypted through _Crypt_EncryptData(). The "issue" I'm having at the moment, is to manage the Login form when the user hasn't already done the login, and so, the main GUI is not visible, but is created... I create the main GUI after the Login form... I tried with WinActive, WinGetState, but nothing changed ( even at the first Login, the script says ( through a MsgBox ) that the Win does exists ( or is active... ) and, as I want, it is not shown again... I really don't know If I missed something, or, I don't know... I'm going crazy for this thing... If someone could help me, I'd really appreaciate it! Thanks for the reading #Region ### START Koda GUI section ### Form=C:\Users\Portatile-60\Documents\Documenti Lavoro\AutoIt\Gestione_Magazzino_v2\form_Login.kxf Global $form_Login = GUICreate("Effettua il Login per continuare:", 405, 120, @DesktopWidth/2 - 202.5, @DesktopHeight/2 - 150) ; 302, 218 GUISetOnEvent($GUI_EVENT_CLOSE, "GUIDeleteLogin") Global $combo_Username = GUICtrlCreateCombo("Di Muro Francesco", 104, 64, 217, 25) GUICtrlSetFont(-1, 10, 400, 0, "Arial") GUICtrlSetData($combo_Username, "somedata") Global $input_Password = GUICtrlCreateInput("", 104, 89, 217, 25, BitOR($GUI_SS_DEFAULT_INPUT,$ES_PASSWORD)) GUICtrlSetFont(-1, 10, 400, 0, "Arial") $button_VerificaDati = GUICtrlCreateButton("", 328, 66, 42, 42, $BS_ICON) GUICtrlSetImage(-1, "C:\Users\Portatile-60\Documents\Documenti Lavoro\AutoIt\Gestione_Magazzino_v2\Icone\icon_check.ico", -1) GUICtrlSetOnEvent($button_VerificaDati, "CheckLogin") $label_Titolo = GUICtrlCreateLabel("Login", 167, 14, 71, 33) GUICtrlSetFont(-1, 18, 800, 0, "Arial") $label_Username = GUICtrlCreateLabel("Username :", 24, 64, 76, 20) GUICtrlSetFont(-1, 10, 800, 0, "Arial") $label_Password = GUICtrlCreateLabel("Password :", 24, 89, 73, 20) GUICtrlSetFont(-1, 10, 800, 0, "Arial") #EndRegion ### END Koda GUI section ### Func CheckLogin() Local $sUsername = GUICtrlRead($combo_Username) Local $sPassword = GUICtrlRead($input_Password) MsgBox($MB_ICONINFORMATION, "", "Username: " & $sUsername & @CRLF & "Password: " & $sPassword) Local $sFileUtenti = @ScriptDir & "\utenti.txt" If @error Then MsgBox($MB_ICONERROR, "Errore!", "Errore durante la lettura del file!") Exit Else Local $hFileUtenti = FileOpen($sFileUtenti, $FO_READ) If @error Then MsgBox($MB_ICONERROR, "Errore!", "Errore durante l'apertura del file " & $sFileUtenti & "." & @CRLF & "Errore: " & @error) Else Local $sDatiUtente, $aDatiUtente Local $bUtenteTrovato = False Local $iLinea = 1 Local $sControlloWin = "" Local $sWin = WinGetState($form_GestioneMagazzino) MsgBox($MB_ICONINFORMATION, "", $sWin) If @error Then MsgBox($MB_ICONERROR, "Errore!", "Errore durante la verifica della GUI attiva." & @CRLF & "Errore: " & @error) EndIf If($sWin == 5) Then MsgBox($MB_ICONINFORMATION, "", "La GUI esiste!") Do $sDatiUtente = FileReadLine($hFileUtenti, $iLinea) $aDatiUtente = StringSplit($sDatiUtente, "|", $STR_NOCOUNT) If(BinaryToString(_Crypt_DecryptData($aDatiUtente[0], "CRYPT", $CALG_RC4)) = $sUsername And BinaryToString(_Crypt_DecryptData($aDatiUtente[1], "CRYPT", $CALG_RC4)) = $sPassword) Then $sControlloWin = "ESISTE" $bUtenteTrovato = True ExitLoop Else $iLinea+=1 If($sDatiUtente = "" And $bUtenteTrovato = False) Then MsgBox($MB_ICONWARNING, "Attenzione!", "Username o Password errati.") ExitLoop EndIf EndIf Until $bUtenteTrovato = True Else MsgBox($MB_ICONINFORMATION, "", "La GUI esiste!") Do $sDatiUtente = FileReadLine($hFileUtenti, $iLinea) $aDatiUtente = StringSplit($sDatiUtente, "|", $STR_NOCOUNT) If(BinaryToString(_Crypt_DecryptData($aDatiUtente[0], "CRYPT", $CALG_RC4)) = $sUsername And BinaryToString(_Crypt_DecryptData($aDatiUtente[1], "CRYPT", $CALG_RC4)) = $sPassword) Then $sControlloWin = "NON ESISTE" $bUtenteTrovato = True ExitLoop Else $iLinea+=1 If($sDatiUtente = "" And $bUtenteTrovato = False) Then MsgBox($MB_ICONWARNING, "Attenzione!", "Username o Password errati.") ExitLoop EndIf EndIf Until $bUtenteTrovato = True EndIf If($sControlloWin = "ESISTE") Then MsgBox($MB_ICONINFORMATION, "Login effettuato!", "Hai effettuato l'accesso come: " & @CRLF & $sUsername & ".") ; Setta come "non-cliccabile" il bottone di Login GUICtrlSetState($button_Login, $GUI_DISABLE) GUICtrlSetState($button_VisualizzaGiacenze, $GUI_ENABLE) GUICtrlSetState($button_AggiungiProdotto, $GUI_ENABLE) GUICtrlSetState($button_PrelevaProdotto, $GUI_ENABLE) GUICtrlSetState($button_RicercaProdotto, $GUI_ENABLE) GUICtrlSetState($button_CreaDDT, $GUI_ENABLE) GUICtrlSetState($button_MostraGiacenzeAZero, $GUI_ENABLE) GUICtrlSetState($combo_Magazzino, $GUI_ENABLE) GUICtrlSetState($button_Logout, $GUI_ENABLE) ; Setta come "non-cliccabile" il bottone di Login GUICtrlSetState($button_Login, $GUI_DISABLE) ; Setta l'utente che ha effettuato l'accesso nella label $label_CaptionUtente GUICtrlSetData($label_CaptionUtente, $sUsername) ; "Distruggi" la GUI Login GUIDelete($form_Login) FileClose($hFileUtenti) Else MsgBox($MB_ICONINFORMATION, "", "La GUI non esiste!") MsgBox($MB_ICONINFORMATION, "Login effettuato!", "Hai effettuato l'accesso come: " & @CRLF & $sUsername & ".") ; Mostra la GUI Principale GUISetState(@SW_SHOW, $form_GestioneMagazzino) ; Setta come "non-cliccabile" il bottone di Login GUICtrlSetState($button_Login, $GUI_DISABLE) ; Setta l'utente che ha effettuato l'accesso nella label $label_CaptionUtente GUICtrlSetData($label_CaptionUtente, $sUsername) ; "Distruggi" la GUI Login GUIDelete($form_Login) FileClose($hFileUtenti) EndIf EndIf EndIf EndFunc Func Logout() GUICtrlSetData($label_CaptionUtente, "") MsgBox($MB_ICONINFORMATION, "Logout effettuato!", "Effettua nuovamente il Login per utilizzare il programma.") ; Disabilita tutti i bottoni della GUI Principale GUICtrlSetState($button_VisualizzaGiacenze, $GUI_DISABLE) GUICtrlSetState($button_AggiungiProdotto, $GUI_DISABLE) GUICtrlSetState($button_PrelevaProdotto, $GUI_DISABLE) GUICtrlSetState($button_RicercaProdotto, $GUI_DISABLE) GUICtrlSetState($button_CreaDDT, $GUI_DISABLE) GUICtrlSetState($button_MostraGiacenzeAZero, $GUI_DISABLE) GUICtrlSetState($combo_Magazzino, $GUI_DISABLE) GUICtrlSetState($button_Logout, $GUI_DISABLE) ; Abilita il Login GUICtrlSetState($button_Login, $GUI_ENABLE) EndFunc EDIT: Solved, making an "integrated" Login form...
  6. Update v1.0.6 Major script overhaul, I literally started over from scratch only adding parts of code from the old script that were solid. I don’t have a help file made as of now so I am going to explain all of the functionality in this post - Form Builder is no longer bi-directional, you now toggle between script mode and GUI mode using a button in the top right or F4 - The script no longer recompiles on every change but instead inserts changes into the script - Form Builder no longer cares about Event mode or GuiGetMsg mode - No more .gui files, you now edit .au3 scripts directly - Script edit is now a SciLexer control, includes syntax highlighting, folding, call tips, keywords, and inline error annotations. - Script output console is now at the bottom in script mode - Main GUI menu redone, most functions from SciTe have been added along with their hotkeys - All restrictions to editing the script have been removed - GDI+ and Graphic editors removed - Cleanup of script, stability greatly increased - Hotkeys no longer use _IsPressed they now use GUIAccelerator keys (with exception to a few) - Multiple scripts can be open - Form Builder buffers the open scripts and adds an asterisk * to scripts that have been modified - Rich Edit, GUIScrollbars, Dummy, and Updown are disabled for now until I can add them - GUI Menu controls cannot be created as of now but will be rendered in the editor - Undo and Redo actions in script mode and GUI mode added, the GUI undo and redo buffer is cleared switching between modes - The Undo and Redo buffers do not have a limit but are cleared when switching between modes or scripts - Undo and Redo actions do not work for controls that have no control handle - The Treeview now works as a Go to function for controls and functions in script mode - Form Builder now tries to preserve as much of the original content as possible, it will save whitespace in-between parameters and comments on controls - Treeview context menu reworked, much more responsive - Unicode support added File -> Encoding -> UTF-8 - Language support added, I added a couple of language files and used Google translate just so I could size my GUI's for different languages, I do not support what those language files say - Selecting a GUI in the Treeview in GUI mode will allow you to change the GUI's Handle, Position, Background Color, State, Cursor, Font, Font Size and Font Attributes - Auto Declare is no longer hiding in the settings, it is now on the top right and is a toggle between Off, Global and Local - Help File Lookup added (Ctrl + H), allows you to search selected text in the help file, Any variable will be searched and the first result will be displayed, any string will be searched as a keyword in the index - Added current script line, column, and selection length in the bottom left - Standard undeclared style constants are checked before script execution and the script will prompt if an undefined style constant is found - You can now toggle script whitespace, EOL characters, line numbers, margins and output in the View menu - View -> Toggle All Folds works as it does in SciTe, only base level folds are changed and the first fold found determines whether to expand or contract - Form Builder Settings redone - Bugs with submitting data and control selection have been fixed - Fixed problems with frequently called repetitive functions causing issues with large scripts - Fixed bugs with B, I, U and S font attribute buttons getting stuck and called when enter was pressed Update v1.0.7 - Help File Look-up hotkey changed to Ctrl+B - Replace hotkey changed to Ctrl+H - Changes to $SCN_MODIFIED so only text events are notified - Bookmarks added, Ctrl+M to add or delete a Bookmark from the current line - Edit -> Bookmarks -> Set Bookmark changes the currently selected Bookmark - Edit -> Clear Current Bookmarks deletes only the currently selected Bookmark - Allows you to change foreground and background colors of Bookmarks - Added F2 hotkey for Next Bookmark - Added Shift+F2 hotkey for Previous Bookmark - Fixed a bug that made it so script annotation did not show up for some people - Script errors and warnings now add a Bookmark on each line - Ctrl+E hotkey added to clear all Bookmarks and Annotations - Minor GUI tweaks - Fixed a bug with the GUI Style undo action - Undo and Redo actions for GUI windows will now update the window properties if the GUI is selected - F4 Hotkey no longer switches modes, switching modes is now F10 - F4 is to toggle next error or warning message, works like it does in SciTe, bookmarks the line and highlights the error in the console - Shift+F4 Hotkey added to toggle previous error or warning message - Shift+F5 Hotkey added to clear script output - Ctrl+F5 Hotkey added as SyntaxCheck Prod - Form Builder now performs a SyntaxCheck before entering GUI Mode and prompts on Error or Warning - Language Select Menu Added Settings -> Lanugage - Icons added to main menu - Languages added to all new menu items and msgbox's - Language Files updated for new data - Language Support added for Arabic, Chinese, Dutch, French, German, Hebrew, Japanese, Swedish, Thai, and Vietnamese [ Google Translate ] - Fixed bug with updating a language that made it look like ANSI and UTF-8 were both selected - Added redo button next to undo button - Font attribute buttons Bold, Italic, Underline and Strike-Out changed to labels Update v1.0.8 - Somehow a main function got deleted causing the script to crash on some changes - Fixed some issues with updating Languages Hotkeys Ctrl + N - New Blank Script Ctrl + G - New GUI Script Ctrl + O - Open Script Ctrl + Shift + S - Save As Ctrl + S - Save Esc - Close Open Script Alt + F4 - Exit Ctrl + Z - Undo Ctrl + Y - Redo Ctrl + X - Cut Ctrl + C - Copy Ctrl + V - Paste Ctrl + A - Select All Ctrl + W - Clear inline script annotation Ctrl + E - Clear inline script annotation and bookmarks Ctrl + F - Find Ctrl + F3 - Find Next Shift + F3 - Find Previous (doesn’t work yet) Ctrl + B - Help File Lookup F5 - Go Alt + F5 - Beta Run F7 - Build Ctrl + F7 - Compile F11 - Full screen F8 - Toggle Show/Hide Script Output Ctrl + I - Open Include Ctrl + H - Replace F1 - AutoIt Help File Ctrl + D - Duplicate Control Delete - Delete Control Ctrl + Shift + 8 - Toggle Show/Hide Script Whitespace Ctrl + Shift + 9 - Toggle Show/Hide Script EOL characters Ctrl - GUI Mode multicontrol selection F10 - Switch Modes F4 - Next Message Shift+F4 - Previous Message Shift+F5 - Clear Output Ctrl+M - Add Bookmark F2 - Next Bookmark Shift+F2 - Previous Bookmark Basic GUI Mode How To Create a Control - click a control on the left - click in the GUI you wish to add the control Left Click: Click and drag to auto resize the control Right Click: Creates the control at a standard size Select a Control - click inside the control or select it in the treeview Change a controls Data - First select the control - modify the controls data on the right, press enter to submit changes state, cursor, font and resizing update when you change the data - when modifying the data parameter the script recognizes if there is a variable in the data and will add quotes accordingly ex. data parameter = $data, End result in script: GUICtrlCreateButton($data, 50, 50, 100, 20) ex. data parameter = data, End result in script: GUICtrlCreateButton("data", 50, 50, 100, 20) ex. data parameter = "data"&$data, End result in script: GUICtrlCreateButton("data"&$data, 50, 50, 100, 20) Applying an Image to a control - select a control - control styles must be applied to some controls before adding an image - click the ... button next to the Image input in the Control Properties area in the bottom right - select the image you want to display, allows jpg, bmp, gif, ico and dll files - selecting a dll will open another prompt to choose which resource to display Control Grouping - multiple controls must be selected - press the group controls button - control grouping allows you to resize and move multiple controls at the same time, as of now groups are deleted when leaving GUI mode I only have a couple odds and ends to finish up before everything should be complete, I need to add Undo and Redo actions for copying and duplicating controls and a couple other minor things, eventually I want to try to add all of the UDF controls as well. If people are willing to translate the language file I would be very grateful, the ones I have right now are from Google translate, I only used them for testing and have no idea what they say. I want to thank Kip, Prog@ndy, Isi360 and all of the other contributors on this forum, without you guys i don't think i could have written this script. Please post any comments, problems or suggestions, BuckMaster * I only used one "magic number" on my main close case statement, only for faster locating, and i don't care. Form Builder Source.zip Form Builder.zip
  7. Hello everybody, I have a problem here ... I need to generate a form of sale and print quality using the form I could do is not getting good, I created a window without borders with the fields I need, then use the function _ScreenCapture_CaptureWnd () to generate a print of this window and send the image to the printer using the UDF printMGv2.au3, the problem is that to get a good quality I would have to create a huge window to get the print, any suggestions to print this form with a good quality? thank you... example of the form it takes:
  8. I am trying to use IE.au3 UDF to auto fill a webpage. All goes well until I get to an editbox that appears to be a javascript. I am attaching a pic of the editbox. (I would be glad to add any other information needed to help me past this last hurdle in my script. I'm just not sure what questions you have to help me with this.)
  9. Hi, I have a form which calls this function: Func HostToIP($Host, $Label) TCPStartup() Local $sIPAddress = TCPNameToIP($Host) If @error Then GUICtrlSetData ($Label, "Error code: " & @error) Else GUICtrlSetData ($Label, $sIPAddress) EndIf TCPShutdown() EndFunc But if it cannot resolve the host to an IP, the whole form freezes for a few seconds until the TCPNameToIP times out, how can I stop the form from freezing whilst it waits for the host to ip times out? TCPNameToIP is part of #include <_sql.au3>
  10. I'm trying to run this code: #include <GuiListView.au3> #include <GUIConstants.au3> Dim $Services Dim $ServicesList #cs While 1 CheckService() Sleep(30000) ; sleep 30 seconds WEnd #ce ;#cs #include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #include <ListViewConstants.au3> #include <TabConstants.au3> #include <WindowsConstants.au3> #Region ### START Koda GUI section ### Form= $Form1 = GUICreate("Form1", 615, 438, 192, 124) $Tab1 = GUICtrlCreateTab(0, 48, 609, 385) $TabSheet1 = GUICtrlCreateTabItem("Running Services") $ListView1 = GUICtrlCreateListView("Service Name|Status", 8, 72, 593, 281, -1, BitOR($LVS_EX_GRIDLINES,$LVS_EX_CHECKBOXES,$LVS_EX_FULLROWSELECT)) GUICtrlSendMsg($ListView1, $LVM_SETCOLUMNWIDTH, 0, 300) GUICtrlSendMsg($ListView1, $LVM_SETCOLUMNWIDTH, 1, 288) $Button1 = GUICtrlCreateButton("Stop Services", 464, 376, 129, 33) $TabSheet2 = GUICtrlCreateTabItem("Stopped Services") GUICtrlSetState(-1,$GUI_SHOW) $ListView2 = GUICtrlCreateListView("Service Name|Status", 8, 72, 593, 281, -1, BitOR($LVS_EX_GRIDLINES,$LVS_EX_CHECKBOXES,$LVS_EX_FULLROWSELECT)) GUICtrlSendMsg($ListView2, $LVM_SETCOLUMNWIDTH, 0, 300) GUICtrlSendMsg($ListView2, $LVM_SETCOLUMNWIDTH, 1, 288) $Button2 = GUICtrlCreateButton("Start Services", 464, 376, 129, 33) GUICtrlCreateTabItem("") GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd ;#ce ;$Tab1 = GUICtrlCreateTab(16, 8, 601, 377) ;$TabSheet1 = GUICtrlCreateTabItem("Running Services") ;$ListView1 = GUICtrlCreateListView("Service Name", 24, 40, 582, 334) ;_GUICtrlListView_SetExtendedListViewStyle($ListView1, BitOR($LVS_EX_FULLROWSELECT, $LVS_EX_CHECKBOXES, $LVS_EX_GRIDLINES)) ;$ServiceName = "wuauserv" Local $Services = ObjGet("winmgmts:\\" & @ComputerName & "\root\cimv2") Local $ServicesList = $Services.ExecQuery("SELECT * FROM Win32_Service") If IsObj($ServicesList) then For $Services in $ServicesList ;If $Services.Name = $ServiceName Then ; if $Services.State = "Running" Then MsgBox(8192,"Hello", $Services.Name & $Services.State,0,$Form1) ;GUICtrlCreateListViewItem( $Services.Name & "|" & $Services.State , $ListView1) ;Run (@ComSpec & " /c " & 'net stop wuauserv') ; EndIf ;EndIf Next EndIf ;EndFunc But the msgbox does turn up when GUI runs. However, if I comment the GUI section, it works perfectly fine. Please help.
  11. How to click the tag <input type="submit" name="submit" id="submit" value="Publish this ad"> on this kind of form? <form name="publish_form" id="publish_form" method="post" action="http://www.example.com/jobs/publish/xxxxx/"> <fieldset> <div class="right"> <div class="suggestion">If you changed your mind, you may <a href="http://www.example.com/jobs/deactivate/xxxxx/" title="cancel posting this ad">cancel posting this ad</a></div> </div> <input type="submit" name="submit" id="submit" value="Publish this ad"> &nbsp;or&nbsp; <a href="http://www.example.com/jobs/post/xxxxx/" title="Edit it">Edit it</a> </fieldset> </form> I already tried this code: #include <IE.au3> Local $oForm = _IEFormGetObjByName($oIE, "publish_form") Sleep(2000) _IEFormSubmit($oForm) But it caused a problem: --> IE.au3 T3.0-1 Error from function _IEFormSubmit, $_IEStatus_COMError (-2147352573) Is there any other way to submit that kind of form?
  12. Could you please show me a script that will set whatever value at the "Description:" field (ONLY!!) of such this kind of a web form: www.fiercewireless.com/jobs/post/ I tried to find a way but I am empty right now..
  13. How to _IEFormElementRadioSelect a radio button that doesn't have a radio group's name or ID? _IEFormElementRadioSelect($o_object, $s_string, $s_name) <fieldset class="share-item"> <legend>share a link or news</legend> <div class="share-item-types"><span class="radio-group-label">Discussion type:</span> <span class="radio-group"> <input type="radio" class="fancy" id="discussion-type-general" name="forumtype" value="7" checked="true" tabindex="0"><label class="radio-label" for="discussion-type-general">General</label> <input type="radio" class="fancy" id="discussion-type-job" name="forumtype" value="5" tabindex="0"><label class="radio-label" for="discussion-type-job">Job</label> <input type="radio" class="fancy" id="discussion-type-promotion" name="forumtype" value="8" tabindex="0"><label class="radio-label" for="discussion-type-promotion">Promotion</label> </span> </div> <div class="share-item-group"> <input type="hidden" value="0" name="contentImageCount" id="share-img-total"> <input type="hidden" value="-1" name="contentImageIndex" id="share-img-selected-idx"> <input type="hidden" value="" name="contentImage" id="share-img-selected-url"> <input type="hidden" value="" name="contentEntityID" id="share-entity-id"> <input type="hidden" value="" name="contentUrl" id="share-entity-url"> <div id="share-mode" class="share-mode"> <div class="share-loading"></div> <div id="share-view" class="share-preview"></div> <div class="share-edit"> <ul id="share-edit-list" class="form"> <li id="share-edit-title-wrapper"> <input type="text" name="contentTitle" value="" id="share-edit-title" tabindex="0" class="text share-edit-title" maxlength="70"> </li> <li id="share-edit-meta"></li> <li id="share-edit-summary-wrapper"> <textarea name="contentSummary" id="share-edit-summary" tabindex="0" class="text" maxlength="250"></textarea> </li> <li id="share-include-photo-wrapper"> <input type="checkbox" name="contentImageIncluded" value="true" id="share-include-photo" class="check" checked="checked" tabindex="0"> <label for="share-include-photo">Include Photo</label> </li> <li> <input type="button" name="#" value="Save" class="btn-primary" id="share-edit-submit" tabindex="0"> or <a href="#" tabindex="0" id="share-edit-cancel">Cancel</a> </li> </ul> </div> </div> <div class="post-actions"> <div class="post-actions-row"> <div class="submit"> <input type="submit" name="postItem" value="Share" class="btn-primary share-submit disabled" id="share-submit" tabindex="0" disabled=""> </div> </div> </div> </div> </fieldset> This is what I want to select: <input type="radio" class="fancy" id="discussion-type-job" name="forumtype" value="5" tabindex="0"><label class="radio-label" for="discussion-type-job">Job</label>
  14. So my job has me fill out these call reports every day i work or do trainings (which is daily or more) and alot of the info is the same. most of it is just clicking checkboxes and putting in 1/0 for Yes/No or asking me to add up all the items in inventory that i have in an excel spreadsheet. i have already made it to the point where i am at the document using the _IE functions but for some reason it wont find the <form>. When i right click the page and look at the source, i can see that the form is present and it has a name. here is a snippet of the source: <html><head><link rel=stylesheet type=text/css href="Styles/DataEntry.css"><title>Call ID: 42189485, Site ID: 01698467, for Rep [348405]</title></head> <body topmargin=0 leftmargin=0 rightmargin=0 onload=init() alink=white link=white vlink=white><span id=loading style=position:absolute>&nbsp;&nbsp;LOADING...<br>&nbsp;&nbsp;PLEASE WAIT</span> <script language=javascript > // //javascript // <span id=full style=visibility:hidden><form class=FM AUTOCOMPLETE=OFF name=QuestionnaireForm method=post action="save.asp" target=_parent> // //input's and checkboxes associated with the form // so i tried to get the object by $oForm = _IEFormGetObjByName($oIE, "QuestionnaireForm") in the console it shows there is no match. is the javascript messing up things?? i have never had so much difficulty trying to automate a site in my life. NOTE: this site can only be viewed in IE. i tried in FF and Chrome and both cant even log in. Any help is appreciated. Thx
  15. Hi all, I'm using an embedded IE object to fill in a form and submit it. The form uses the POST method and has a Javascript function which runs when the form is submitted and changes some values according to what is entered into the form and generates a nonce, etc. When the form is submitted a file download is triggered. How could I deal with this because at the minute the file download dialog is appearing? The only way I can think of is to send a keypress when the file download window becomes active but I have seen that this is not reliable. Thanks in advance
  16. Hi all, question to those who are familiar with Winhttp, in particular _WinHttpSimpleFormFill() I have a form that I fill out and submit using _WinHttpSimpleFormFill() which then returns a subsequent form based on the first form. How do I then fill out the subsequent form? #include "WinHTTP.au3" $sFile = @ScriptDir & "\test.csv" $sFileHTM = @ScriptDir & "\Form.htm" $hSession = _WinHttpOpen('Mozilla/5.0 (Windows NT 5.1; rv:2.0) Gecko/20100101 Firefox/4.0'); create new session $hConnect = _WinHttpConnect($hSession, "www.server.com") ; connect to server $sHTM = _WinHttpSimpleFormFill($hConnect, "form.cfm", "name:CFForm_2", "name:FileContents", $sFile, "name:import_vendor", "Generic") ;HERE I NEED TO FILL OUT THE SECOND FORM THAT IS RETURNED IN $sHTM If $sHTM Then MsgBox(64 + 262144, "Done!", "Will open returned page in your default browser now." & @CRLF & _ "It should show array of uploaded files below the form.") $hFileHTM = FileOpen($sFileHTM, 2) FileWrite($hFileHTM, $sHTM) FileClose($hFileHTM) ShellExecuteWait($sFileHTM) EndIf Cheers!
  17. I have looked and read for 2 days now without finding what I assume is a simple solution. Can someone please look at the codebelow and help me to understand why when the gui opens the controls on the default tab (tab1) do not show up unless another tab is selected and tab1 is re-selected. I am trying to get the controls to be available when the form opens. This code uses GUIScrollbars_Ex.au3 which I have attached if needed. and reads a MobileMan.ini file the contents wich are below. Thank you, [Groups] ActiveGroups=MobileTest,Mobile [Mobile] ActiveHosts=computer1,computer2,computer3,computer4 [MobileTest] ActiveHosts=computer5,computer6 #include <GuiConstants.au3> #include <GuiEdit.au3> #Include <Date.au3> #include <GUIScrollbars_Ex.au3> #include <Array.au3> $Logfile = @ScriptDir & '\' & @YEAR & "-" & @MON & "-" & @MDAY & "_" & @HOUR & "-" & @min & "-" & @SEC & "_" & 'MobileMan.log' Global $aHosts[1][18] = [[0, "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "",""]] ;~ Create Gui $sTitle = "Mobile Management Console" $sINI = @ScriptDir & "\MobileMan.ini" $GUI = GUICreate($sTitle,900, 570, -1, -1) $MessageMenu = GUICtrlCreateMenu("&File") $HelpMenu = GUICtrlCreateMenu("Help") GUICtrlCreateTab(160,10,730,310) $tabFreeform = GUICtrlCreateTabItem("tab1") $tabInpMessage = GUICtrlCreateInput("Enter text here...", 180,50,400,40, $ES_MULTILINE ) GUICtrlCreateTabItem("tab2") GUICtrlCreateTabItem("tab3") GUICtrlCreateTabItem("tab4") GUISetState() ;~ Create Child gui $cGUI = GUICreate("Child GUI", 140,525,10,10, $WS_CHILD, $WS_EX_CLIENTEDGE, $Gui) GUICtrlSetResizing($cGUI, $GUI_DOCKALL) Opt("GUICoordMode", 2) $GrpCord = GUISetCoord(5,5) $bToggleAll = GUICtrlCreateButton("Toggle All", -1, 1, 115, 20) GUISetState() FileOpen($Logfile,1) FileWrite($Logfile, _Now() & " - Session started" & @CRLF) ;~ Read ini $aGroups = IniReadSection($sINI, "Groups") If @error Then MsgBox(16, "Error", "Failed to read 'Groups' section.") FileWrite($Logfile, _Now() & " - Failed to read 'Groups' section" & @CRLF) Exit EndIf If ($aGroups[0][0] >= 1) And ($aGroups[1][0] = "ActiveGroups") Then $aActiveGroups = StringSplit($aGroups[1][1], ",") If ($aActiveGroups[0] = 1) And (StringStripWS($aActiveGroups[1], 8) = "") Then Dim $aActiveGroups[1] = [0] Else MsgBox(16, "Error", "Missing or invalid Groups keys.") FileWrite($Logfile, _Now() & " - Missing or invalid Groups keys" & @CRLF) Exit EndIf For $g = 1 To $aActiveGroups[0] $sGroupName = $aActiveGroups[$g] $aGroupSection = IniReadSection($sINI, $sGroupName) If @error Then MsgBox(16, "Error", "Failed to read groups section: '" & $sGroupName & "'.") FileWrite($Logfile, _Now() & " - Failed to read groups section: '" & $sGroupName & "'" & @CRLF) ContinueLoop EndIf If ($aGroupSection[0][0] >= 1) And ($aGroupSection[1][0] = "ActiveHosts") Then $aActiveHosts = StringSplit($aGroupSection[1][1], ",") If ($aActiveHosts[0] = 1) And (StringStripWS($aActiveHosts[1], 8) = "") Then Dim $aActiveHosts[1] = [0] For $h = 1 To $aActiveHosts[0] _AddActiveHost($sGroupName, $aActiveHosts[$h]) Next Else MsgBox(16, "Error", "Missing or invalid keys in group: '" & $sGroupName & "'.") FileWrite($Logfile, _Now() & " - Missing or invalid keys in group: '" & $sGroupName & "'." & @CRLF) ContinueLoop EndIf Next Dim $GrpButton[($aActiveGroups[0] + 1)] $Btn_Start = GUICtrlCreateDummy() For $g = 1 To $aActiveGroups[0] $GrpButton[$g] = GUICtrlCreateButton($aActiveGroups[$g],-1, 1, 115, 20) FileWrite($Logfile, _Now() & " - Group created: '" & $aActiveGroups[$g] & "'" & @CRLF) For $n = 1 To $aHosts[0][0] if $aActiveGroups[$g] = $aHosts[$n][0] then $aHosts[$n][2] = GUICtrlCreateCheckbox($aHosts[$n][1],-1,0,130,15) if $aActiveGroups[$g] = $aHosts[$n][0] then FileWrite($Logfile, _Now() & " - Host created: '" & $aHosts[$n][1] & "'") if $aActiveGroups[$g] = $aHosts[$n][0] then $aHosts[$n][3] = IniRead($sINI, $aActiveGroups[$g], 'Share','C$') ;~ if $aActiveGroups[$g] = $aHosts[$n][0] then $aHosts[$n][4] = ping ($aHosts[$n][1],$PingTimeout) ;~ if not $aHosts[$n][4] = 1 then GUICtrlSetState ($aHosts[$n][2],$GUI_DISABLE) if $aHosts[$n][4] = 1 then GUICtrlSetState ($aHosts[$n][2],$GUI_ENABLE) if $aActiveGroups[$g] = $aHosts[$n][0] and not $aHosts[$n][4] = 1 then FileWrite($Logfile, " -DISABLED" & @CRLF) Elseif $aActiveGroups[$g] = $aHosts[$n][0] Then FileWrite($Logfile, @CRLF) EndIf Next Next $Btn_End = GUICtrlCreateDummy() _GUIScrollbars_Generate($cGUI, 0, ($n * 15) + ($g * 21)) ;number of checkboxes in the list * 15 pixels (height of the checkbox + spacing ???) GUISetState() ;~ _ArrayDisplay($aActiveGroups) ;~ _ArrayDisplay($aHosts) While 1 $msg = GUIGetMsg() Switch $msg ;~ If $msg = $GUI_EVENT_CLOSE Then Case $GUI_EVENT_CLOSE Exit ;~ ElseIf $msg = $bToggleAll Then Case $bToggleAll For $n = 1 To $aHosts[0][0] If $aHosts[$n][0] = True Then If ControlCommand($cGUI, "", $aHosts[$n][2], "IsEnabled") Then If ControlCommand($cGUI, "", $aHosts[$n][2], "IsChecked") Then ControlCommand($cGUI, "", $aHosts[$n][2], "Uncheck") Else ControlCommand($cGUI, "", $aHosts[$n][2], "Check") EndIf EndIf EndIf Next Case $bToggleAll For $n = 1 To $aHosts[0][0] If $aHosts[$n][0] = True Then If ControlCommand($cGUI, "", $aHosts[$n][2], "IsEnabled") Then If ControlCommand($cGUI, "", $aHosts[$n][2], "IsChecked") Then ControlCommand($cGUI, "", $aHosts[$n][2], "Uncheck") Else ControlCommand($cGUI, "", $aHosts[$n][2], "Check") EndIf EndIf EndIf Next Case $Btn_Start To $Btn_End For $n = 1 To $aHosts[0][0] If $aHosts[$n][0] = GUICtrlRead($Msg) Then If ControlCommand($cGUI, "", $aHosts[$n][2], "IsEnabled") Then If ControlCommand($cGUI, "", $aHosts[$n][2], "IsChecked") Then ControlCommand($cGUI, "", $aHosts[$n][2], "Uncheck") Else ControlCommand($cGUI, "", $aHosts[$n][2], "Check") EndIf EndIf EndIf Next EndSwitch WEnd Func _AddActiveHost($sGrp, $sHost) ReDim $aHosts[UBound($aHosts) + 1][UBound($aHosts, 2)] ; Resize the array $aHosts[0][0] = UBound($aHosts) - 1 ; Save count in [0][0] $aHosts[$aHosts[0][0]][0] = $sGrp ; Put group in [n][0] $aHosts[$aHosts[0][0]][1] = $sHost ; Put host in [n][1] EndFunc ;==>_AddActiveHostGUIScrollbars_Ex.au3
  18. Hi guys, I'm new to autoit, but so far I love using it and have been having a blast working on test automation with it. However, I've hit a snag, in that I need to select an option from a select that displays on a page, but the select for whatever reason is not located within a form. At first I assumed this was wrong, but after double checking with _IEFormGetCollection, none of the forms contained the select I need to access. So my question is, how do I select this option, so that I might move on with my script, when the select is not part of a form. I've tried using _IE action, and I've had little success so far. Thank you, Athos
  19. Hello I developed a form generator (formHandler) for using in my programs; in the attached file there is a newer version. The attached zip file contains : formhandler.au3 the script which generate a formsbFormHandler.au3 a script for test and understand formHandlerAutoItFormHandler.pdf a formHandler documentationGradient.au3 a function for create graphics gradients. Compared to some others I've seen published, this makes the diagonal gradient (provided that the area is square) and asymmetric reflectionsbgradient.au3 a script for test de gradient function which also demonstrate an use of formHandlerfunctions.au3 contains some functions used for not include some library.I hope this can be usefulformhandler.zip
  20. hello guys im just asking about how to open web page inside a form ( i want my script to be like a web browser that only open the web page that i have wrote already before )
  21. Dear AutoIt community, How do I get AutoIt to read all the options of an IE select box into an array so I can tell it to go through each selection one by one? I know the name of the selection box (via IE-Builder) but I'm having a difficult time figuring out the code to get AutoIt to read all of the selection options. The end result I want is to get AutoIt to select each option one by one and submit the form. I figure I need to get AutoIt to 'read' each selection string of the selection box and put each string into an array to do a FOR IN NEXT loop so AutoIt can go through them one by one submitting the form each time. If there is an an easier way please let me know. Of course I've pressed F1 but I can't see anything in the help file that will help :-) As usual any and all help is greatly appreciated. -icu
  • Create New...