Sign in to follow this  
Followers 0
Maxaki

Send Tab key loop with delay

11 posts in this topic

#1 ·  Posted (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.

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("{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 by Melba23
Added code tags

Share this post


Link to post
Share on other sites



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.

Share this post


Link to post
Share on other sites

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._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

If someone needs to automate the HP Update Assistant installation with updates and installation of drivers.

Here is the code.

;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")

Share this post


Link to post
Share on other sites

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._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites

Melba23,

Ok, I'll respond like this in the future. Thanks for helping me out.

/Andreas

Share this post


Link to post
Share on other sites

Maxaki,

Thanks. :thumbsup:

M23


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0