AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Hotkey Activation help

 
Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
jhaadsma
Guest





PostPosted: Wed Mar 10, 2010 12:45 pm    Post subject: Hotkey Activation help Reply with quote

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

PostPosted: Wed Mar 10, 2010 1:12 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
Guest






PostPosted: Wed Mar 10, 2010 1:31 pm    Post subject: Reply with quote

... 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






PostPosted: Wed Mar 10, 2010 1:36 pm    Post subject: Reply with quote

damn... how did I screw that up? Embarassed

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
Display posts from previous:   
Reply to topic    AutoHotkey Community Forum Index -> Ask for Help All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group