Post by Slevin » 16 May 2018, 10:37
Hallo Leute,
ich bin kompletter Neuling was AHK angeht, von daher sorry für zwei vielleicht komplett simple Fragen.
Ich möchte, dass mein Script nach einer bestimmten AFK Zeit alle eingebundenen Platten auswirft. Das klappt soweit erst mal (Script gekürzt):
Code: Select all
Loop,
{
If (A_TimeIdle < 5000) {
Sleep, 1000
} else {
MsgBox, 64, For Your Information, Checkout done at %A_Hour%:%A_Min%
}
}
Aber ich will auch, dass das kompilierte Script im Tray-Menu nur "Exit" beinhaltet, und eine OnExit Routine sicherstellt, dass im Exit-Fall die Platten ebenfalls ausgeworfen werden. Leider ist das bisher nur Wunsch, die Loop-Operation wird nicht ausgeführt:
Code: Select all
#Persistent
Menu, tray, NoStandard
Menu, tray, add, Exit, ExitHandler
OnExit, ExitSub
return
ExitHandler:
ExitApp
return
ExitSub:
if A_ExitReason not in Logoff,Shutdown
{
MsgBox, 64, For Your Information, Exit-Checkout done at %A_Hour%:%A_Min%
}
ExitApp
Loop,
{
If (A_TimeIdle < 5000) {
Sleep, 1000
} else {
MsgBox, 64, For Your Information, Checkout done at %A_Hour%:%A_Min%
}
}
Schön wäre es auch noch, wenn man irgendwie den Tooltip von "Dateiname.exe" auf "Fantasiename" ändern könnte.
Gibt es außerdem eine Möglichkeit, das Script zu beenden obwohl die MessageBox noch am Display steht? Also eine Art Good-Bye Information zu hinterlassen, obwohl das Script selbst bereits nicht mehr im System ist.
Vielen Dank schon mal für jedwede Hilfe
Slevin
Hallo Leute,
ich bin kompletter Neuling was AHK angeht, von daher sorry für zwei vielleicht komplett simple Fragen.
Ich möchte, dass mein Script nach einer bestimmten AFK Zeit alle eingebundenen Platten auswirft. Das klappt soweit erst mal (Script gekürzt):
[code]
Loop,
{
If (A_TimeIdle < 5000) {
Sleep, 1000
} else {
MsgBox, 64, For Your Information, Checkout done at %A_Hour%:%A_Min%
}
}
[/code]
Aber ich will auch, dass das kompilierte Script im Tray-Menu nur "Exit" beinhaltet, und eine OnExit Routine sicherstellt, dass im Exit-Fall die Platten ebenfalls ausgeworfen werden. Leider ist das bisher nur Wunsch, die Loop-Operation wird nicht ausgeführt:
[code]
#Persistent
Menu, tray, NoStandard
Menu, tray, add, Exit, ExitHandler
OnExit, ExitSub
return
ExitHandler:
ExitApp
return
ExitSub:
if A_ExitReason not in Logoff,Shutdown
{
MsgBox, 64, For Your Information, Exit-Checkout done at %A_Hour%:%A_Min%
}
ExitApp
Loop,
{
If (A_TimeIdle < 5000) {
Sleep, 1000
} else {
MsgBox, 64, For Your Information, Checkout done at %A_Hour%:%A_Min%
}
}
[/code]
Schön wäre es auch noch, wenn man irgendwie den Tooltip von "Dateiname.exe" auf "Fantasiename" ändern könnte.
Gibt es außerdem eine Möglichkeit, das Script zu beenden obwohl die MessageBox noch am Display steht? Also eine Art Good-Bye Information zu hinterlassen, obwohl das Script selbst bereits nicht mehr im System ist.
Vielen Dank schon mal für jedwede Hilfe
Slevin