Can anyone tell me why this script will not work?
Dim CursorKeyEvent : CursorKeyEvent = ConnectEvent(Application,
"OnCursorKey", "OnCursorKey")
Function OnCursorKey(CursorKeyId, isBeforeAction, defaultActionAborted)
If isBeforeAction Then
Dim objAction1 : Set objAction1 = CursorKeyId.FirstAction
Dim objAction2 : Set objAction2 = CursorKeyId.SecondAction
Dim strAction1 : strAction1 = objAction1.ActionID
Dim strAction2 : strAction2 = objAction2.ActionID
Speak strAction1
Speak strAction2
End If
OnCursorKey = False
End Function
I get this error when I use a cursor key with the script running.
CursorKeyTest.vbs - Microsoft VBScript runtime error
Line 7 Column 18
Object doesn't support this property or method: 'objAction1.ActionID'
< 0x800A01B6 >
Vic