Post by garry » 12 Mar 2023, 05:55
deux exemples
Code: Select all
#Warn
#Singleinstance,force
setworkingdir, %a_scriptdir%
Process,Exist,notepad.exe
;- run notepad for test
If Not ErrorLevel
Run,notepad
return
;--------
$t::
Send {Blind}T
sleep,2000 ;- envoyer toutes les 2 secondes
return
;--------
esc::exitapp
;============
Code: Select all
#Warn
#Singleinstance,force
setworkingdir, %a_scriptdir%
act:=1
Process,Exist,notepad.exe
;- run notepad for test
If Not ErrorLevel
Run,notepad
sc:="ahk_exe notepad.exe"
global act
return
;--------
$F8:: ;- start
act:=1
IfWinNotExist, ahk_exe notepad.exe
Run, notepad.exe
IfWinNotActive ,%sc%,,WinActivate,%sc%
WinWaitActive,%sc%
While, act A1()
Return
A1()
{
loop
{
send,{text}T
sleep,2000 ;- 2 second pour test
}
Until, !act
}
return
;---------------
$F9:: ;- stop
act:=0
return
;--------------
esc::exitapp
;==============
deux exemples
[code]
#Warn
#Singleinstance,force
setworkingdir, %a_scriptdir%
Process,Exist,notepad.exe
;- run notepad for test
If Not ErrorLevel
Run,notepad
return
;--------
$t::
Send {Blind}T
sleep,2000 ;- envoyer toutes les 2 secondes
return
;--------
esc::exitapp
;============
[/code]
[code]
#Warn
#Singleinstance,force
setworkingdir, %a_scriptdir%
act:=1
Process,Exist,notepad.exe
;- run notepad for test
If Not ErrorLevel
Run,notepad
sc:="ahk_exe notepad.exe"
global act
return
;--------
$F8:: ;- start
act:=1
IfWinNotExist, ahk_exe notepad.exe
Run, notepad.exe
IfWinNotActive ,%sc%,,WinActivate,%sc%
WinWaitActive,%sc%
While, act A1()
Return
A1()
{
loop
{
send,{text}T
sleep,2000 ;- 2 second pour test
}
Until, !act
}
return
;---------------
$F9:: ;- stop
act:=0
return
;--------------
esc::exitapp
;==============
[/code]