 |
AutoHotkey Community Let's help each other out
|
| View previous topic :: View next topic |
| Author |
Message |
Guest
|
Posted: Sat Oct 31, 2009 9:38 pm Post subject: Noob question with hotkey |
|
|
~F1::
sleep 100
run, my_program
sleep 5000
winclose, my_program
return
OK, that's pretty basic and works. Now I need this:
~F1::
sleep 100
run, my_program
sleep 5000
F1 here = winclose, my_program (not running my_program again)
F1 now is restored and should run again my_program when pressed
return |
|
| Back to top |
|
 |
jethrow
Joined: 24 May 2009 Posts: 722 Location: Iowa, USA
|
Posted: Sat Oct 31, 2009 9:50 pm Post subject: |
|
|
Something like this? | Code: | #IfWinExist, my_program
F1:: WinClose, my_program
#IfWinExist
F1::
Sleep, 100
Run, my_program
Return |
Is that what you're looking for? _________________ AHKL, COM_L,Webpage Controls,Donate to AHK |
|
| Back to top |
|
 |
Guest
|
Posted: Sat Oct 31, 2009 10:11 pm Post subject: |
|
|
#IfWinExist, Untitled - Notepad
F1::
WinClose, Untitled - Notepad ahk_class Notepad
#IfWinExist
F1::
Run, notepad
Return
I've tried it with a real example and it works, but when F1 closes Notepad, it runs it again. ?¿? |
|
| Back to top |
|
 |
jethrow
Joined: 24 May 2009 Posts: 722 Location: Iowa, USA
|
Posted: Sat Oct 31, 2009 10:13 pm Post subject: |
|
|
That's because you didn't copy my example
If the hotkey is more that one line, the script will keep executing until it reaches the end of the script, or a terminating command (Return, Exit, ExitApp). _________________ AHKL, COM_L,Webpage Controls,Donate to AHK |
|
| 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
|