 |
AutoHotkey Community Let's help each other out
|
| View previous topic :: View next topic |
| Author |
Message |
Breta Guest
|
Posted: Wed May 21, 2008 1:44 pm Post subject: Run&Reload |
|
|
| Why Reload command does not work in lower line than i have Run command to another scripts in my basic script ?? Is there a way how to solve it? |
|
| Back to top |
|
 |
sinkfaze
Joined: 18 Mar 2008 Posts: 139
|
Posted: Wed May 21, 2008 1:47 pm Post subject: |
|
|
Post your script, please? _________________ Have trouble searching the site for information? Try Quick Search for Autohotkey. |
|
| Back to top |
|
 |
Breta Guest
|
Posted: Wed May 21, 2008 2:24 pm Post subject: |
|
|
if i place PROBLEM on first line in the script then it works but APPSKEY doesn't
| Code: | #Persistent
#SingleInstance force
Run E:\Documents and Settings\D-L-X\Plocha\akh.ahk
Run E:\Documents and Settings\D-L-X\Plocha\stahuj.ahk
Run E:\Documents and Settings\D-L-X\Plocha\trezzor.ahk
#IfWinActive ahk_class Notepad ; PROBLEM
#r::
send,^s
SoundPlay, %A_WinDir%\Media\soubor.wav
sleep 2000
reload
return
APPSKEY::
switch := !switch
if switch
{
Run E:\Staženo\emule
WinWait, E:\Staženo\emule
WinMove,,, 0, 0, 420, 988
Run E:\Staženo\soulseek
WinWait, E:\Staženo\soulseek
WinMove,,, 420, 0, 420, 988
Run E:\Staženo\torrent
WinWait, E:\Staženo\torrent
WinMove,,, 840, 0, 420, 988
Run E:\Staženo\dc++
WinWait, E:\Staženo\dc++
WinMove,,, 1260, 0, 420, 988
}
else
{
IfWinExist, E:\Staženo\dc++
WinClose
IfWinExist, E:\Staženo\torrent
WinClose
IfWinExist, E:\Staženo\soulseek
WinClose
IfWinExist, E:\Staženo\emule
WinClose
}
return
#IfWinActive ahk_class IrfanView
#SingleInstance force
Rbutton::
keywait, rbutton, t0.339
if errorlevel = 1
{
;
;'press-n-hold'
;
IfWinNotExist, ahk_class OpWindow
Run E:\Program Files\Opera\Opera.exe
WinWait, ahk_class OpWindow
WinActivate
WinMaximize
SendInput ^t
return
IfWinExist, ahk_class OpWindow
WinActivate
return
}
else
keywait, rbutton, d, t0.1327633948
if errorlevel = 0
{
;
; 'double click'
;
SendInput !{F4}
return
}
else
;
; regular single click
;
Send {Right}
return
#IfWinActive ahk_class #32770 ;emule
#t::
run E:\Program Files\eMule\Temp
WinWait, E:\Program Files\eMule\Temp
WinSet, AlwaysOnTop, On
return |
|
|
| Back to top |
|
 |
HugoV
Joined: 27 May 2007 Posts: 650
|
|
| Back to top |
|
 |
Breta Guest
|
Posted: Wed May 21, 2008 7:12 pm Post subject: |
|
|
| its really hard english for me.. can you give me explain please? |
|
| Back to top |
|
 |
Jex Guest
|
Posted: Wed May 28, 2008 2:49 pm Post subject: |
|
|
it's because you are assuming that the .ahk files will open with notepad. but this is not the case. they will be opened with the default program which is most likely autohotkey.exe
if you change the code to this:
| Code: |
Run Notepad.exe E:\Documents and Settings\D-L-X\Plocha\akh.ahk
Run Notepad.exe E:\Documents and Settings\D-L-X\Plocha\stahuj.ahk
Run Notepad.exe E:\Documents and Settings\D-L-X\Plocha\trezzor.ahk
|
it will open the files in Notepad.
OR
add return after the first part:
| Code: | #SingleInstance force
#IfWinActive ahk_class Notepad
Run E:\Documents and Settings\D-L-X\Plocha\akh.ahk
Run E:\Documents and Settings\D-L-X\Plocha\stahuj.ahk
Run E:\Documents and Settings\D-L-X\Plocha\trezzor.ahk
Return ;Here
#r::
send,^s
SoundPlay, %A_WinDir%\Media\soubor.wav
sleep 2000
reload
return |
adding return will switch back to allow input. and not need an Ahk_class Notepad to be open to run. |
|
| Back to top |
|
 |
another guy Guest
|
Posted: Wed May 28, 2008 2:57 pm Post subject: |
|
|
do you want the script to autorun the other three?
if you do i suggest:
| Code: | #Persistent
#SingleInstance force
Run E:\Documents and Settings\D-L-X\Plocha\akh.ahk
Run E:\Documents and Settings\D-L-X\Plocha\stahuj.ahk
Run E:\Documents and Settings\D-L-X\Plocha\trezzor.ahk
;#IfWinActive ahk_class Notepad ; Remove this line
#r::
send,^s
SoundPlay, %A_WinDir%\Media\soubor.wav
sleep 2000
reload
return
APPSKEY::
switch := !switch
if switch
{
Run E:\Staženo\emule
WinWait, E:\Staženo\emule
WinMove,,, 0, 0, 420, 988
Run E:\Staženo\soulseek
WinWait, E:\Staženo\soulseek
WinMove,,, 420, 0, 420, 988
Run E:\Staženo\torrent
WinWait, E:\Staženo\torrent
WinMove,,, 840, 0, 420, 988
Run E:\Staženo\dc++
WinWait, E:\Staženo\dc++
WinMove,,, 1260, 0, 420, 988
}
else
{
IfWinExist, E:\Staženo\dc++
WinClose
IfWinExist, E:\Staženo\torrent
WinClose
IfWinExist, E:\Staženo\soulseek
WinClose
IfWinExist, E:\Staženo\emule
WinClose
}
return
#IfWinActive ahk_class IrfanView
#SingleInstance force
Rbutton::
keywait, rbutton, t0.339
if errorlevel = 1
{
;
;'press-n-hold'
;
IfWinNotExist, ahk_class OpWindow
Run E:\Program Files\Opera\Opera.exe
WinWait, ahk_class OpWindow
WinActivate
WinMaximize
SendInput ^t
return
IfWinExist, ahk_class OpWindow
WinActivate
return
}
else
keywait, rbutton, d, t0.1327633948
if errorlevel = 0
{
;
; 'double click'
;
SendInput !{F4}
return
}
else
;
; regular single click
;
Send {Right}
return
#IfWinActive ahk_class #32770 ;emule
#t::
run E:\Program Files\eMule\Temp
WinWait, E:\Program Files\eMule\Temp
WinSet, AlwaysOnTop, On
return |
if you remove that line then you don't need to be running an ahk_class notepad to run the rest of the script. |
|
| 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
|