jbsoccerbrit Posted November 1, 2010 Share Posted November 1, 2010 (edited) Ive looked at iniread, but I am not sure how I would get it to work to read the contents of the ini in the 3 areas below. Any help would be greatly appreciated thank you. expandcollapse popup#region ---Au3Recorder generated code Start --- Opt("WinWaitDelay",100) Opt("WinDetectHiddenText",1) Opt("MouseCoordMode",0) _WinWaitActivate("IPO : INISETTING1 - Microsoft Internet Explorer","") MouseClick("left",31,158,1) _WinWaitActivate("IPO -- Web Page Dialog","") Sleep ( 5000 ) Send("INISETTING2{TAB}") Sleep ( 5000 ) Send("INISETTING3{TAB}{TAB}{TAB}{TAB}{TAB}") Sleep ( 5000 ) Send("{enter}") Sleep ( 5000 ) Send ("{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}") Sleep ( 5000 ) Send ("{space}") Sleep ( 2000 ) Send ("{TAB}{TAB}{TAB}") Sleep ( 2000 ) Send ("w") Sleep ( 1000 ) Send ("{TAB}") Sleep ( 1000 ) Send ("{enter}") Sleep ( 5000 ) Send ("{SHIFTDOWN}{tab}{SHIFTUP}") Sleep ( 500 ) Send ("m") Sleep ( 500 ) Send ("{tab}") Sleep ( 100 ) Send ("test") Sleep ( 100 ) Send ("{tab}") Sleep ( 100 ) Send ("test") Sleep ( 100 ) Send ("{tab}{tab}") Sleep ( 100 ) Send ("11112222") Sleep ( 100 ) Send ("{tab}") Send ("Job") Sleep ( 100 ) Send ("{tab}") Sleep ( 100 ) Send ("street") Sleep ( 100 ) Send ("{tab}") Sleep ( 100 ) Send ("30000{tab}") Sleep ( 2000 ) Send ("{tab}{tab}") Sleep ( 100 ) Send ("123456789{tab}") Sleep ( 100 ) Send ("123456789{tab}") Sleep ( 100 ) Send ("{tab}{tab}{tab}{tab}{tab}{enter}") Sleep ( 5000 ) Send ("{tab}{tab}{tab}{tab}{tab}{tab}{tab}{tab}{tab}{tab}{tab}{tab}{tab}{tab}{tab}{tab}{tab}{tab}{tab}{tab}{tab}{tab}{tab}{tab}{tab}{tab}{tab}{tab}{tab}{tab}{tab}") Sleep ( 5000 ) Send ("{enter}") Sleep ( 2000 ) Send ("{space}") Sleep ( 500 ) Send ("{tab}") Sleep ( 500 ) Send ("{space}") Sleep ( 500 ) Send ("{tab}") Sleep ( 500 ) Send ("{space}") Sleep ( 500 ) Send ("{tab}") Sleep ( 500 ) Send ("{space}") Sleep ( 500 ) Send ("{tab}{RIGHT}") Sleep ( 500 ) Send ("{tab}{tab}{tab}{tab}{tab}") Sleep ( 2000 ) Send ("{enter}") Sleep ( 5000 ) Send ("{RIGHT}") Sleep ( 500 ) Send ("{tab}{tab}{tab}") Sleep ( 2000 ) Send ("{enter}") Sleep ( 2000 ) Send ("{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}") Sleep ( 2000 ) Send ("{enter}") Sleep ( 5000 ) Send ("{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}") Sleep ( 5000 ) Send ("{enter}") Sleep ( 5000 ) Send ("{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}") Sleep ( 2000 ) Send ("{enter}") Sleep ( 2000 ) Send ("{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}") Sleep ( 1000 ) Send ("{DOWN}{DOWN}") Sleep ( 1000 ) Send ("{tab}{tab}{tab}{tab}") Sleep ( 3000 ) Send ("{enter}") Sleep ( 5000 ) Send ("{tab}{tab}{tab}{tab}{tab}{tab}{tab}{tab}{tab}{tab}{tab}{tab}{tab}{tab}{tab}{tab}{tab}{tab}{tab}{tab}{tab}{tab}{tab}{tab}{tab}{tab}{tab}") Sleep ( 3000 ) Send ("{enter}") Sleep ( 3000 ) Send ("{enter}") Sleep ( 3000 ) Send ("{tab}{tab}{tab}{tab}{tab}{tab}{tab}{tab}{tab}{tab}{tab}{tab}{tab}{tab}{tab}{tab}{tab}{tab}{tab}{tab}{tab}{tab}{tab}{tab}{tab}{tab}{tab}{tab}{tab}{tab}{tab}{tab}{tab}{tab}{tab}{tab}{tab}{tab}{tab}{tab}{tab}{tab}{tab}{tab}{tab}{tab}{tab}{tab}{tab}{tab}{tab}{tab}{tab}{tab}{tab}{tab}{tab}{tab}{tab}{tab}{tab}{tab}{tab}{tab}{tab}{tab}{tab}{tab}{tab}{tab}{tab}{tab}{tab}") Sleep ( 6000 ) Send ("{enter}") Sleep ( 3000 ) Send ("{tab}") Sleep ( 500 ) Send ("{enter}") Sleep ( 3000 ) #region --- Internal functions Au3Recorder Start --- Func _WinWaitActivate($title,$text,$timeout=0) WinWait($title,$text,$timeout) If Not WinActive($title,$text) Then WinActivate($title,$text) WinWaitActive($title,$text,$timeout) EndFunc #endregion --- Internal functions Au3Recorder End --- #endregion --- Au3Recorder generated code End --- Edited November 1, 2010 by jbsoccerbrit Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted November 1, 2010 Moderators Share Posted November 1, 2010 jbsoccerbrit,The Ini* functions are designed to work directly with the ini file on disk - not as part of a web page dialog. You need to find the file in which the strings are saved and then use the Ini* functions on that file. If you want to interact directly with the web page dialog, look at the IE.au3 UDF - it should allow you to read (and change) the contents of the web page. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
jbsoccerbrit Posted November 1, 2010 Author Share Posted November 1, 2010 (edited) I'll try and explain further if it helps. Basically I want the script to read the ini values so it can pass them onto the webpage in some cases. For example if I need a username in the place of INISETTING1 I can save it to the .ini file and then kick off the script so it just reads that value. Later on however the web app requests 2 sets of 9 digit numbers and these are the main things that need to be inserted. Kinda like sending it to the webpage via a gui of sorts I guess but actually read from an ini. Hopefully that makes sense. Edited November 1, 2010 by jbsoccerbrit Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted November 1, 2010 Moderators Share Posted November 1, 2010 jbsoccerbrit,Basically I want the script to read the ini valuesSo what is the name of the ini file and what settings are you trying to read from it?pass them onto the webpageThis is where the IE UDF will come in handy as it should enable you to do this directly without the need to Send several hundred {TAB} keys. What is the url of this page so we can look at its internal structure?M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
jbsoccerbrit Posted November 1, 2010 Author Share Posted November 1, 2010 (edited) I just made something like temp.ini and placed it at the root of my c:\ _WinWaitActivate("IPO : "$var1 = IniRead("C:\temp.ini", "section1", "username", "NotFound")" - Microsoft Internet Explorer","") MouseClick("left",31,158,1) _WinWaitActivate("IPO -- Web Page Dialog","") Sleep ( 5000 ) Send(""$var2 = IniRead("C:\temp.ini", "section2", "numbers1", "NotFound")"{TAB}") Sleep ( 5000 ) Send(""$var3 = IniRead("C:\temp.ini", "section3", "numbers2", "NotFound")"{TAB}{TAB}{TAB}{TAB}{TAB}") contents of the ini would be like [section1] username=namehere [section2] numbers1=123456789 [section3] numbers2=123456789 The value of username doesnt actually have to be passed to the webpage, but section 2 and section 3's contents would have to be. As long as section 1 usersname matches the username of the web app already being used everything should work. The webpage itself is an internal tool, so I cant actually give it out... sorry, but thank you for the help. Edited November 1, 2010 by jbsoccerbrit Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted November 1, 2010 Moderators Share Posted November 1, 2010 jbsoccerbrit, Bit of problem with syntax there! To read your ini and use the values you need something like this: ; read the user name $sUserName = IniRead("C:\temp.ini", "section1", "username", "NotFound") ; make sure we found one! If $sUsername <> "NotFound" Then ; read the numbers $sNumbers1 = IniRead("C:\temp.ini", "section2", "numbers1", "NotFound") $sNumbers2 = IniRead("C:\temp.ini", "section3", "numbers2", "NotFound") ; now put these into the web page _WinWaitActivate("IPO : " & $sUserName & " - Microsoft Internet Explorer","") MouseClick("left",31,158,1) _WinWaitActivate("IPO -- Web Page Dialog","") Sleep ( 5000 ) Send($sNumbers1 & "{TAB}") Sleep ( 5000 ) Send($sNumbers2 & "{TAB}{TAB}{TAB}{TAB}{TAB}") Else ; Some thing else if the username was not found EndIf You do not need separate sections for each value, but it does not hurt. I hope that helps. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
AlmarM Posted November 1, 2010 Share Posted November 1, 2010 You guys know you could use "{TAB 5}" right? Minesweeper A minesweeper game created in autoit, source available. _Mouse_UDF An UDF for registering functions to mouse events, made in pure autoit. 2D Hitbox Editor A 2D hitbox editor for quick creation of 2D sphere and rectangle hitboxes. Link to comment Share on other sites More sharing options...
jbsoccerbrit Posted November 1, 2010 Author Share Posted November 1, 2010 Melba23 thank you so very much that works perfectly thank you thank you thank you. Link to comment Share on other sites More sharing options...
jbsoccerbrit Posted November 1, 2010 Author Share Posted November 1, 2010 AlmarM thanks also, I adjusted my script to do the tabbing method you mentioned and that little tip will save me a lot of time in the future. Link to comment Share on other sites More sharing options...
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