What I'm interested in is:
1: Why does Example 6 let the script successfully run, but not with Example 3?
2: Why does Example 3 throw a different error than Example 7?
3: Why does Example 8 let the script successfully run, but not with Example 7?
4: Why does Example 2 not let the script successfully run?
5: Why does Example 7 have a line of Exit in the debugger readout, but not in any other errors shown below?
I'm wondering why the inconsistencies and what the final verdict on how these will be able to be used in scripts? I do this this new direction of defining hotkeys with the curly braces.
I personally like this ability to put the curly bracket after the double-colons in my hotkey definition as it feels more like a function definition.
Code: Select all
like this e.g.:
#x::{
; code here
; code here
}
...okay, now some examples of what is working and what is not:
Example 1: this works
Code: Select all
#x::MsgBox( "test" )
Example 2: this code below throws the following error
Code: Select all
#x::{ MsgBox( "test" ) }
Code: Select all
Error: This line does not contain a recognized action.
Specifically: { MsgBox( "test" ) }
Line#
---> 003: {
Example 3: this code below throws the following error
Code: Select all
#x
#y::{
MsgBox( "test" )
}
Code: Select all
Error at line 6.
Line Text: #x
Error: This line does not contain a recognized action.
Example 4: this works
Code: Select all
#x
#y::
{
MsgBox( "test" )
}
Example 5: this works
Code: Select all
#x::
{
MsgBox( "test" )
MsgBox( "test" )
}
Example 6: this works
Code: Select all
#x::{
MsgBox( "test" )
MsgBox( "test" )
}
Example 7: this code below throws the following error
Code: Select all
NumpadHome::
NumpadEnd::
NumpadClear::
NumpadPgDn::
NumpadPgUp::
NumpadDel::
NumpadIns::{
!GetKeyState( "NumLock", "T" ) ? MsgBox( "TURN ON NUMPAD", "NumLock Warning", "IconX T1" ) : ""
}
Code: Select all
Error: Missing "key:" in object literal.
Line#
012: {
---> 012: { !GetKeyState( "NumLock", "T" ) ? MsgBox( "TURN ON NUMPAD", "NumLock Warning", "IconX T1" ) : "" }
012: }
013: Exit
Example 8: this works
Code: Select all
NumpadHome::
NumpadEnd::
NumpadClear::
NumpadPgDn::
NumpadPgUp::
NumpadDel::
NumpadIns::
{
!GetKeyState( "NumLock", "T" ) ? MsgBox( "TURN ON NUMPAD", "NumLock Warning", "IconX T1" ) : ""
}