| View previous topic :: View next topic |
| Author |
Message |
edbighead
Joined: 10 Feb 2009 Posts: 4
|
Posted: Tue Feb 10, 2009 9:32 pm Post subject: Pauses |
|
|
I have this form online where I have to highlight and select from a list. This is the macro that I use to get to the right part of the page, select all, and then go to the next page. After I go to the next page I need to run the process over again. For some reason I cannot figure out how to put a pause into the macro so that it gives the page time to load before it runs the macro again. Also how can I make it so it repeats X number of times.
Thanks!
heres the code that doesnt work. doesnt seem to pause and just goes into tabbing again while its still loading
#space::Send {TAB}{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}{SPACE}{TAB}{TAB}{SPACE}{TAB}{TAB}{SPACE}{TAB}{TAB}{SPACE}{TAB}{TAB}{SPACE}{TAB}{TAB}{SPACE}{TAB}{TAB}{SPACE}{TAB}{TAB}{SPACE}{TAB}{TAB}{SPACE}{TAB}{TAB}{SPACE}{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}{SPACE} sleep, 5000 {TAB}{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}{SPACE}{TAB}{TAB}{SPACE}{TAB}{TAB}{SPACE}{TAB}{TAB}{SPACE}{TAB}{TAB}{SPACE}{TAB}{TAB}{SPACE}{TAB}{TAB}{SPACE}{TAB}{TAB}{SPACE}{TAB}{TAB}{SPACE}{TAB}{TAB}{SPACE}{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}{SPACE}
Should it be on a seperate line or what? |
|
| Back to top |
|
 |
Heavenguard Guest
|
Posted: Tue Feb 10, 2009 9:37 pm Post subject: |
|
|
You can use Sleep, ####, with the #### being milliseconds (so 1000 = 1s)
As for the repetition, you can loop it
| Quote: | To perform something more than once consecutively, a loop is the answer. The following loop shows a MsgBox three times:
Loop 3
{
MsgBox This window will be displayed three times.
} |
|
|
| Back to top |
|
 |
edbighead
Joined: 10 Feb 2009 Posts: 4
|
Posted: Tue Feb 10, 2009 9:40 pm Post subject: |
|
|
| for some reason it doesnt pause with what i have now, which is what you just showed me i believe |
|
| Back to top |
|
 |
edbighead
Joined: 10 Feb 2009 Posts: 4
|
Posted: Tue Feb 10, 2009 9:47 pm Post subject: |
|
|
| i've tried every combination of spaces, commas, and line changes. Sleep function doesnt seem to be working |
|
| Back to top |
|
 |
edbighead
Joined: 10 Feb 2009 Posts: 4
|
Posted: Tue Feb 10, 2009 9:49 pm Post subject: |
|
|
| could someone show me an example of sleep being used in a script with keyboard commands. would be a great help, thanks |
|
| Back to top |
|
 |
evan Guest
|
Posted: Tue Feb 10, 2009 9:54 pm Post subject: |
|
|
| Code: | #space::
send {tab}
sleep 1000
send {space}
return |
|
|
| Back to top |
|
 |
Sivvy
Joined: 21 Jul 2008 Posts: 726 Location: Calgary, AB, Canada
|
Posted: Wed Feb 11, 2009 3:57 pm Post subject: |
|
|
Sleep must be on a separate line, because otherwise your actually issuing a Windows command for sleep, rather than the AHK one.
| Code: | #Space::
Loop 2
{
Send, {Tab 8}{Space}
Loop 9
Send, {Tab 2}{Space}
Send, {Tab 9}{Space}
If %A_Index% = 1
Sleep, 5000
}
Return |
Untested. |
|
| Back to top |
|
 |
|