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 

Script won't run when AutoHotKey Help file has focus

 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
MrGibbage



Joined: 18 Nov 2009
Posts: 5

PostPosted: Wed Nov 18, 2009 2:56 am    Post subject: Script won't run when AutoHotKey Help file has focus Reply with quote

Brand new user here. I downloaded and installed AHK today at work using the .exe installer download. At the end of the installation, there is an option to open the README file, which I chose. I navigated to the Tutorial (quick start) section and followed the instructions on creating a script to open the google web page with the default web browser. I created the file, loaded it, pressed ctrl-space and it worked. I then continued to read the help file to learn more about the program. Along the way, I pressed ctrl-space again but surprisingly, nothing happened. I tried reloading the script, and still nothing. After playing around a little, it finally worked. At first I couldn't figure out why it worked one time but not others. But I finally narrowed it down to if the AHK Help file had the focus, the script would not work. 100% repeatability. I closed the help file and launched it again using the help option from the tray icon. This time it worked every time, as expected.

When I got home, I installed AHK on my home computer. At the last step, again I was given the option to open the README file. "Ahh", I wondered. Will it happen again? Sure enough, when the help file has the focus, the script won't run.

This is troublesome because new users like myself might be following along in the help file, and start having problems like I described above, and think the problems lie in the script.

I hope this helps.

By the way, AHK seems like a fantastic program. I can't wait to have some good scripts running on my computer.
Back to top
View user's profile Send private message
Wrong Section Alert
Guest





PostPosted: Wed Nov 18, 2009 6:20 am    Post subject: Reply with quote

This post should be in Ask for Help, not Bug Reports.

Though the poster does not say which code he tried, it sounds very much like he is testing the Send command, which sends key stokes only to the active window.
Back to top
SKAN



Joined: 26 Dec 2005
Posts: 7159

PostPosted: Wed Nov 18, 2009 6:24 am    Post subject: Reply with quote

Quote:
Though the poster does not say which code he tried


MrGibbage wrote:
I navigated to the Tutorial (quick start) section and followed the instructions on creating a script to open the google web page with the default web browser. I created the file, loaded it, pressed ctrl-space and it worked.


but doc example uses win+space.
Code:
#space::Run www.google.com
Back to top
View user's profile Send private message
MrGibbage



Joined: 18 Nov 2009
Posts: 5

PostPosted: Wed Nov 18, 2009 11:39 am    Post subject: Reply with quote

Well, I really think it is a bug. I followed the instructions exactly as they are presented in the help file (autohotkey.chm).
Download and install AutoHotkey.
Right-click an empty spot on your desktop or in a folder of your choice.
In the menu that appears, select New -> AutoHotkey Script.
Type a name for the file, ensuring that it ends in .ahk. For example: Test.ahk
Right-click the file and choose Edit Script.
On a new blank line, type the following:
#space::Run www.google.com

The hotkey and script work fine when the help file does not have the focus. If the help file has the focus, then it doesn't work. And to make matters ever more strange, this is only observed if the help file is launched as part of the installation process. If I manually open the help file now (by "now", I mean now that I have already installed the program and exited out of the installer), then the script runs fine.

I found this out "by accident" on my work computer, but then I was able to recreate it at home. I have not tried re-installing AHK to see if it happens on subsequent installations. All I know is it happens for sure on the first installation (at least two times for me, anyways).

I hope that helps.
Back to top
View user's profile Send private message
MrGibbage



Joined: 18 Nov 2009
Posts: 5

PostPosted: Wed Nov 18, 2009 11:40 am    Post subject: Reply with quote

Whoops, I meant to say win+space.

SKAN wrote:
Quote:
Though the poster does not say which code he tried


MrGibbage wrote:
I navigated to the Tutorial (quick start) section and followed the instructions on creating a script to open the google web page with the default web browser. I created the file, loaded it, pressed ctrl-space and it worked.


but doc example uses win+space.
Code:
#space::Run www.google.com
Back to top
View user's profile Send private message
SKAN



Joined: 26 Dec 2005
Posts: 7159

PostPosted: Wed Nov 18, 2009 11:51 am    Post subject: Reply with quote

MrGibbage wrote:
Download and install AutoHotkey.
Right-click an empty spot on your desktop or in a folder of your choice.
In the menu that appears, select New -> AutoHotkey Script.
Type a name for the file, ensuring that it ends in .ahk. For example: Test.ahk
Right-click the file and choose Edit Script.
On a new blank line, type the following:
#space::Run www.google.com


I tried exactly as above, but I am unable to reproduce the effect.
Something is strange on your system.. If possible, try on an another machine.
Back to top
View user's profile Send private message
MrGibbage



Joined: 18 Nov 2009
Posts: 5

PostPosted: Wed Nov 18, 2009 12:22 pm    Post subject: Reply with quote

Wow, this happened to me twice, on two different machines, with two different operating systems. Strange. I've got one more computer I can try it on. I'll try later tonight.
Back to top
View user's profile Send private message
MrGibbage



Joined: 18 Nov 2009
Posts: 5

PostPosted: Thu Nov 19, 2009 1:21 am    Post subject: Reply with quote

I just tried it on a third computer and I have the exact same results. Here are the steps to recreate the symptoms:
1. Download the latest AHK installer from http://www.autohotkey.com/download/AutoHotkeyInstall.exe
2. Install using defaults.
3. At the end of the installation, ensure the option to open the README file is checked. Click finish and the documentation will launch.
4. Click on the getting started option from the menu.
5. Follow the steps to create the google launcher script.
#space::Run www.google.com
6. Load the script by double-clicking it.
7. Click the help file to ensure it has the focus.
7. Press win+space
8. Observe that if the help file has the focus, the web browser does NOT launch the google web site. I have noticed that something happens, but I can't tell what (open windows are flashing or something... really strange). Sometimes the help file will lose the focus at this point, and pressing win+space a second will work correctly.

Comments
Any time the help file has focus, the script will not properly execute. If the help file does not have the focus, the script will execute properly. If you close down the help file altogether, and then launch it again by other means, the script will execute even if the help file has focus, so this seems to be a one-time deal.

On my computer at home, I tried reinstalling AHK, and going through the steps again, and it did indeed exhibit the same symptoms described above. So this does not seem to be limited to the very first installation. I have not tested the reinstallation on all of my computers.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   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