 |
AutoHotkey Community Let's help each other out
|
| View previous topic :: View next topic |
| Author |
Message |
feejo
Joined: 16 Jun 2007 Posts: 245
|
Posted: Wed Feb 27, 2008 4:14 pm Post subject: Send work only if a msgbox is before |
|
|
I have a script that work well for months. Totay it stop. It is simple but it dose not want to send the content of the variable pv to the screen.
so I place a msgbox, just before the send command, then it start to send it. Seem the msgbox make some sort of a pause, I don't know.
| Code: |
a:=1
pv:= a*1.2
MouseClick, Left, 860,-650,2 ; PRIX
Send {CTRLDOWN}a{CTRLUP}
Sleep, 500
msgbox, pv=%pv%
Send, %pv%
|
|
|
| Back to top |
|
 |
ManaUser
Joined: 24 May 2007 Posts: 906
|
Posted: Wed Feb 27, 2008 8:25 pm Post subject: |
|
|
Try putting a slight delay there instead Like this:
|
|
| Back to top |
|
 |
feejo
Joined: 16 Jun 2007 Posts: 245
|
Posted: Wed Feb 27, 2008 8:28 pm Post subject: |
|
|
| I try sleep 500 and it react the same way. |
|
| Back to top |
|
 |
[VxE]
Joined: 07 Oct 2006 Posts: 1494
|
Posted: Wed Feb 27, 2008 9:05 pm Post subject: |
|
|
Most likely, when the msgbox closes, it restores focus to the top-most window (I think your trouble has been losing focus. | Code: |
Myhwnd := WinExist("a")
a:=1
pv:= a*1.2
MouseClick, Left, 860,-650,2 ; PRIX
Send {CTRLDOWN}a{CTRLUP}
;;Sleep, 500
;;msgbox, pv=%pv%
WinActivate, ahk_id %Myhwnd%
WinWaitActive, ahk_id %Myhwnd%
sleep, 25
Send, %pv%
|
see if that works. _________________ My Home Thread
More Common Answers: [1]. It's in the FAQ [2]. Ternary ( a ? b : c ) guide [3]. Post code inside [code][/code] tags ! |
|
| Back to top |
|
 |
|
|
You can post new topics in this forum You can reply to topics in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|