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 

#Include - unexplainable behaviour (for me)

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



Joined: 20 Apr 2007
Posts: 31

PostPosted: Mon Sep 08, 2008 2:32 pm    Post subject: #Include - unexplainable behaviour (for me) Reply with quote

I have AutoHotkey v1.0.47.06. I have this lines in autohotkey.ini:
Code:
#NoEnv
#Persistent
#NoTrayIcon
#SingleInstance Force

#Include Scripts\volume.ahk
#Include Scripts\programs.ahk
#Include Scripts\misc.ahk

Eveything working as it's supposed, but if I include misc.ahk, before volume.ahk, volume.ahk doesn't work at all, the other 2 scripts run just fine.

Volume script is here.
Misc script:
Code:
;Command Prompt paste (Ctrl + V)
#IfWinActive, ahk_class ConsoleWindowClass
   ^v::SendInput, {RAW}%Clipboard%
#IfWinActive

;Total Commander new file
#IfWinActive, ahk_class TTOTAL_CMD
   f8::Send, +{F4}
#IfWinActive

;mIRC Close Tab (Ctrl + W)
SetTitleMatchMode, 2
#IfWinActive, mIRC - [
   ^w::Send, ^{F4}
#IfWinActive

And programs script look like that (don't think it has something to do with the problem):
Code:
DetectHiddenWindows, On
SetTitleMatchMode, RegEx
SetTitleMatchMode, Fast

;Function to run program
RunProgram(Class, Path, WorkingDir = "", Exclude = "")
{
   IfExist, %Path%
      IfWinNotExist, ahk_class %Class%,, %Exclude%
         Run, %Path%, %WorkingDir%
      WinActivate
   Return
}

;Total Commander (WinKey + E)
#e::RunProgram("TTOTAL_CMD", "D:\Installed\totalcmd\TOTALCMD.EXE", "D:\Installed\totalcmd\")

;Firefox (Ctrl + Alt + F)
^!f::RunProgram("MozillaUIWindowClass", "C:\Program Files\Mozilla Firefox\firefox.exe", "C:\Program Files\Mozilla Firefox\", "Downloads")

;some other programs..

;Screenshot (fullscreen) (Ctrl + Printscreen)
^printscreen::Run, D:\Installed\cap.exe /fs /cursor /f="C:\Documents and Settings\steliyan\Desktop\f_.png" /time /del="_"
Back to top
View user's profile Send private message
tonne



Joined: 06 Jun 2006
Posts: 1259
Location: Denmark

PostPosted: Mon Sep 08, 2008 3:54 pm    Post subject: Reply with quote

Read this on Auto-execute Section.
_________________
there's a dog barking close within the range of my ear
sounds like he wants to escape the chain
he would probably bite me to death if he could
but the chain lets me spit in his face

- Kashmir
Back to top
View user's profile Send private message
Serenity



Joined: 07 Nov 2004
Posts: 1276

PostPosted: Mon Sep 08, 2008 3:59 pm    Post subject: Reply with quote

You should place the hotkeys (#IfWinActive ...) after the auto-exec section.
_________________
"Anything worth doing is worth doing slowly." - Mae West
Back to top
View user's profile Send private message Visit poster's website
steliyan



Joined: 20 Apr 2007
Posts: 31

PostPosted: Mon Sep 08, 2008 5:36 pm    Post subject: Reply with quote

Thanks for your answers. Smile
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