Maxaki Posted January 20, 2014 Posted January 20, 2014 (edited) Hey. Long time lurker here. This forum is really great, a lot of my noobscripting issues has been solved because of you friendly guys. Just now registered because I couldn't find any relevant thread about this issue. The script is as following, the main thing I want is as the Topic says: a delay loop instead of this awful piece of code.expandcollapse popupSend("{TAB}") Sleep("20") Send("{TAB}") Sleep("20") Send("{TAB}") Sleep("20") Send("{TAB}") Sleep("20") Send("{TAB}") Sleep("20") Send("{TAB}") Sleep("20") Send("{TAB}") Sleep("20") Send("{TAB}") Sleep("20") Send("{TAB}") Sleep("20") Send("{TAB}") Sleep("20") Send("{TAB}") Sleep("20") Send("{TAB}") Sleep("20") Send("{TAB}") Sleep("20") Send("{TAB}") Sleep("20") Send("{TAB}") Sleep("20") Send("{TAB}") Sleep("20") Send("{TAB}") Sleep("20") Send("{TAB}") Sleep("20") Send("{TAB}") Sleep("20") Send("{TAB}") Sleep("20") Send("{TAB}") Sleep("20") Send("{TAB}") Sleep("20") Send("{TAB}") Sleep("20") Send("{TAB}") Sleep("20") Send("{TAB}") Sleep("20") Send("{TAB}") Sleep("20") Send("{TAB}") Sleep("20") Send("{TAB}") Sleep("20") Send("{DOWN}") Sleep("20") Send("{ENTER}") Sleep("20") Send("{TAB}") Sleep("20") Send("{TAB}") Sleep("20") Send("{TAB}") Sleep("20") Send("{TAB}") Sleep("20") Send("{SPACE}") Sleep("20") Send("{TAB}") Sleep("20") Send("{SPACE}") Sleep("20") Send("{TAB}") Sleep("20") Send("{TAB}") Sleep("20") Send("{SPACE}") Sleep("20") Send("{TAB}") Sleep("20") Send("{TAB}") Sleep("20") Send("{TAB}") Sleep("20") Send("{SPACE}") Sleep("20") Send("{TAB}") Sleep("20") Send("{ENTER}") Sleep("1000") Appreciate all help I can get, take care! Edited January 20, 2014 by Melba23 Added code tags
sumanthupar Posted January 20, 2014 Posted January 20, 2014 Hi Maxaki, Try like this For $j=1 To 20 send ("{TAB}") sleep (100) Next Send ("{DOWN}") just change the number of tab for how much u need.
Moderators Melba23 Posted January 20, 2014 Moderators Posted January 20, 2014 Maxaki,Welcome to the AutoIt forum. When you post code please use Code tags - see here how to do it. Then you get a scrolling box and syntax colouring as you can see above now I have added the tags. 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
l3ill Posted January 20, 2014 Posted January 20, 2014 Hi Maxaki, and welcome to the forums! In my experience it is not necessary to sleep between tabs so you may want to try this Send("{TAB 20}") also there are usually much better ways of automating most software then sending keys... Bill My Contributions... SnippetBrowser NewSciTE PathFinder Text File Manipulation FTP Connection Tester / INI File - Read, Write, Save & Load Example
Maxaki Posted January 20, 2014 Author Posted January 20, 2014 Maxaki, Welcome to the AutoIt forum. When you post code please use Code tags - see here how to do it. Then you get a scrolling box and syntax colouring as you can see above now I have added the tags. M23 Okay, thnx! Hi Maxaki, and welcome to the forums! In my experience it is not necessary to sleep between tabs so you may want to try this Send("{TAB 20}") also there are usually much better ways of automating most software then sending keys... Bill It's HP Update Assistant (To update drivers) which seems to have very bad interaction with AutoIT. I need HPUA on my automated image installation to do all the driver updates for HP on the specific computers. First of, it installs the software, goes thru the menu to select the auto update option and then restarts computer with autologon from unattend which will finally update all the HP drivers needed. I did a test with the window info tool to see if I could do any interaction to click a "Close" button but it would not work, even with [CLASS:name]. It doesn't seem to detect that the window exists. Using the Kace2000 to deploy my images and going to use this as a post install.
l3ill Posted January 20, 2014 Posted January 20, 2014 Sure, whatever works. Just throwing it out there... ...another little tip: ALT+F4 will close almost any active window... cya, Bill My Contributions... SnippetBrowser NewSciTE PathFinder Text File Manipulation FTP Connection Tester / INI File - Read, Write, Save & Load Example
Maxaki Posted January 20, 2014 Author Posted January 20, 2014 Hi Maxaki, Try like this For $j=1 To 20 send ("{TAB}") sleep (100) Next Send ("{DOWN}") just change the number of tab for how much u need. Seems to work, thanks a lot, now I can actually show the code to other people =) Sure, whatever works. Just throwing it out there... ...another little tip: ALT+F4 will close almost any active window... cya, Bill Yea that's true I'll use that, thank you.
Maxaki Posted January 20, 2014 Author Posted January 20, 2014 If someone needs to automate the HP Update Assistant installation with updates and installation of drivers. Here is the code. expandcollapse popup;Domain admin information Local $sUserName = "xxxx" Local $sDomain = "xxx" Local $sPassword = "xxx" ;Executes the HPUA with administrator rights $SupportAssistant = 'networkpath\HPDrivers\SupportAssistant\setup.exe /silent' RunAs($sUsername, $sDomain, $sPassword, 0,@ComSpec & " /c " & $SupportAssistant, @SystemDir, @SW_Show) ;Needs to be done to close the "finished installation" window, because AutoIT cannot interact with it. ProcessWait("msiinstaller.exe") ProcessWaitClose("msiinstaller.exe") Sleep(20000) ProcessClose("setup.exe") Sleep(3000) ;Execute the HPSF locally. 10Sec sleep because program has to load. ShellExecute(@ProgramFilesDir & "\Hewlett-Packard\HP Support Framework\HPSF.exe") Sleep("10000") ;Set Automatic update options For $a=1 To 28 send ("{TAB}") sleep (100) Next Send ("{DOWN}") Sleep("20") Send("{ENTER}") Sleep("20") For $b=1 To 4 send ("{TAB}") sleep (100) Next Send("{SPACE}") Sleep("20") Send("{TAB}") Sleep("20") Send("{SPACE}") Sleep("20") Send("{TAB}") Sleep("20") Send("{TAB}") Sleep("20") Send("{SPACE}") Sleep("20") For $c=1 To 3 send ("{TAB}") sleep (100) Next Send("{SPACE}") Sleep("20") Send("{TAB}") Sleep("20") Send("{ENTER}") Sleep("1000") ;Execute the HPSFUpdater to automatically update the HPSA client and HP Drivers. ShellExecute(@ProgramFilesDir & "\Hewlett-Packard\HP Support Framework\Resources\Updater\HPSFUpdater.exe")
Moderators Melba23 Posted January 20, 2014 Moderators Posted January 20, 2014 Maxaki,I hate to appear a nag, but when you reply in future, please use the "Reply to this topic" button at the top of the thread or the "Reply to this topic" editor at the bottom rather than the "Quote" button - responders know what they wrote and it just pads the thread unneccessarily. 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
Maxaki Posted January 20, 2014 Author Posted January 20, 2014 Melba23, Ok, I'll respond like this in the future. Thanks for helping me out. /Andreas
Moderators Melba23 Posted January 20, 2014 Moderators Posted January 20, 2014 Maxaki,Thanks. 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
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