 |
AutoHotkey Community Let's help each other out
|
| View previous topic :: View next topic |
| Author |
Message |
jhaadsma Guest
|
Posted: Wed Mar 10, 2010 12:45 pm Post subject: Hotkey Activation help |
|
|
Hi all-
Cannot get script to run with hotkey enabled. How do you make a hotkey
available at all times while a script is running?
My code below. At anytime I want the user to be able to hit the F12, input a message and have it displayed in the text box of the GUI.
Jim
#SingleInstance force
F12::Goto, DailyMessage
return
Gui, Add, Button, x5 y5 w100 h20 , Calculator
Gui, Add, Button, x5 y25 w100 h20 , Notepad
gui, font, s12 , Verdana
Gui, Add, Text , x5y70 w300 h15 +0x800000, %DailyNotice%
Gui, Show, x140 y110 h80 w330, CS Dashboard
Return
ButtonNotepad:
Gui, submit
Run, Notepad.exe, C:\My Documents, max
return
ButtonCalculator:
Gui, submit
Run, calc.exe, C:\My Documents, max
return
DailyMessage:
InputBox, DailyNotice, Daily Notice, Please enter your message, , 300, 100
return
GuiClose:
ExitApp |
|
| Back to top |
|
 |
wooly_sammoth
Joined: 12 May 2009 Posts: 634 Location: Gloucester UK
|
Posted: Wed Mar 10, 2010 1:12 pm Post subject: |
|
|
Try putting the Hotkey at the bottom of the script.
Currently the script is running up to the return after the hotkey and then not running any more.
Pop the hotkey at the end then the Gui will run |
|
| Back to top |
|
 |
Guest
|
Posted: Wed Mar 10, 2010 1:31 pm Post subject: |
|
|
... and please use code tags around you code, it makes it much easier to read.
| Code: | #SingleInstance force
F12::Goto, DailyMessage
return
Gui, Add, Button, x5 y5 w100 h20 , Calculator
Gui, Add, Button, x5 y25 w100 h20 , Notepad
gui, font, s12 , Verdana
Gui, Add, Text , x5y70 w300 h15 +0x800000, %DailyNotice%
Gui, Show, x140 y110 h80 w330, CS Dashboard
Return
F12::Goto, DailyMessage ; put almost anywhere... after the end of the auto-execute section
return
ButtonNotepad:
Gui, submit
Run, Notepad.exe, C:\My Documents, max
return
ButtonCalculator:
Gui, submit
Run, calc.exe, C:\My Documents, max
return
DailyMessage:
InputBox, DailyNotice, Daily Notice, Please enter your message, , 300, 100
return
GuiClose:
ExitApp | ... see how much nicer that looks? |
|
| Back to top |
|
 |
Guest
|
Posted: Wed Mar 10, 2010 1:36 pm Post subject: |
|
|
damn... how did I screw that up?
| Code: | #SingleInstance force
Gui, Add, Button, x5 y5 w100 h20 , Calculator
Gui, Add, Button, x5 y25 w100 h20 , Notepad
gui, font, s12 , Verdana
Gui, Add, Text , x5y70 w300 h15 +0x800000, %DailyNotice%
Gui, Show, x140 y110 h80 w330, CS Dashboard
Return
F12::Goto, DailyMessage ; put almost anywhere... after the end of the auto-execute section
return
ButtonNotepad:
Gui, submit
Run, Notepad.exe, C:\My Documents, max
return
ButtonCalculator:
Gui, submit
Run, calc.exe, C:\My Documents, max
return
DailyMessage:
InputBox, DailyNotice, Daily Notice, Please enter your message, , 300, 100
return
GuiClose:
ExitApp |
|
|
| 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
|