Hello Scripters and specifically Jamal,
Jamal, due to the way your logic is written in:
Function HandleStateChange(sObject, bLoaded)
you need to insure that you do not Queue the call to check for update. You
need to insure it completes before you hit the code below.
For those interested, here is how I troubleshooted the issue:
1. I first added a bunch of lines that looked like the following:
Dim boolFlag
boolFlag = False
If oHomer Is Nothing Then
Speak "Homer not found"
boolFlag = True
Else
Speak "Homer found"
End If
If oHotkeyManager Is Nothing Then
Speak "hotkey manager not found"
boolFlag = True
Else
Speak "hotkey manager found"
End If
If oHelpDialog Is Nothing Then
Speak "Help dialog not found"
boolFlag = True
Else
Speak "Help dialog found"
End If
If oCheckForUpdate Is Nothing Then
Speak "check for update not found"
boolFlag = True
Else
Speak "Check for Update found"
End If
If oErrorReporting Is Nothing Then
Speak "error reporting not found"
boolFlag = True
Else
Speak "Error Reporting Found"
End If
If boolFlag Then
SetData "ScriptInitialized", False
Else
If iHandleHotkey = 0 Then ConnectEvent Application, "OnHotkey",
"HandleHotkey"
If iHandleActivate = 0 Then ConnectEvent DesktopWindow, "OnChildActivate",
"HandleActivate"
RegisterHotkeys
SetData "ScriptInitialized", True
End If
End Function
The code originally looked like this:
If oHomer Is Nothing Or oHotkeyManager Is Nothing Or oHelpDialog Is Nothing
Or oCheckForUpdate Is Nothing Or oErrorReporting Is Nothing Then
SetData "ScriptInitialized", False
Else
If iHandleHotkey = 0 Then ConnectEvent Application, "OnHotkey",
"HandleHotkey"
If iHandleActivate = 0 Then ConnectEvent DesktopWindow, "OnChildActivate",
"HandleActivate"
RegisterHotkeys
SetData "ScriptInitialized", True
End If
End Function
I did this to pin point which shared object was failing.
2. I then examined the SetCheckForUpdate procedure and found a bug. I
changed it to this:
If oScriptINI.Number("Automatic_Updates", "OnScriptStart", 0) = 1 Then
oCheckForUpdate.CheckForUpdate
In addition, I added a speak statement to it at the top. So, it read:
Speak "Checking for update"
Set oCheckForUpdate =
SharedObjects("com.GWMicro.GWToolkit.CheckForUpdate").NewCheck
With oCheckForUpdate
.ScriptVersion = oData("ScriptVersion")
.UpdateUrl = oData("ScriptUpdateURL")
End With
If oScriptINI.Number("Automatic_Updates", "OnScriptStart", 0) = 1 Then
oCheckForUpdate.CheckForUpdate
3. I then ran the code and noticed that CheckForUpdate was not being seen
or, well, it was but the issues still persisted where keys were not being
initialized.
4. I then went to the on state change function and did this:
Case "com.GWMicro.GWToolkit.CheckForUpdate"
If bLoaded Then
Call SetCheckForUpdate
Else
Set oCheckForUpdate = Nothing
End If
I had to change the SetCheckForUpdate to a sub from a function as well, so
it read:
Sub SetCheckForUpdate()
' Set CheckForUpdate object, and check if auto setting
Speak "Checking for update"
Set oCheckForUpdate =
SharedObjects("com.GWMicro.GWToolkit.CheckForUpdate").NewCheck
With oCheckForUpdate
.ScriptVersion = oData("ScriptVersion")
.UpdateUrl = oData("ScriptUpdateURL")
End With
If oScriptINI.Number("Automatic_Updates", "OnScriptStart", 0) = 1 Then
oCheckForUpdate.CheckForUpdate
End Sub
I then ran the script, and guess what, it worked.
So, there you go, everyone should be happy <grin>.
----- Original Message -----
From: "Jamal Mazrui" <[EMAIL PROTECTED]>
To: <[email protected]>
Sent: Thursday, September 11, 2008 7:29 PM
Subject: Re: IE max follow up.
I'm not finding the note you seem to be referencing. What did you find
out?
Jamal
On Thu, 11 Sep 2008, Jeff Bishop wrote:
Date: Thu, 11 Sep 2008 19:13:12 -0700
From: Jeff Bishop <[EMAIL PROTECTED]>
Reply-To: [email protected]
To: [email protected]
Subject: Re: IE max follow up.
See my note about IEMax, it is an issue with CheckForUpdate.
----- Original Message -----
From: "Jamal Mazrui" <[EMAIL PROTECTED]>
To: <[email protected]>
Sent: Thursday, September 11, 2008 7:09 PM
Subject: Re: IE max follow up.
> What version of IE? Can you install Query Settings, press Alt-Insert-Q
> with IE as the active window, and report whether IE Max is mentioned?
>
> Jamal
> On
> Thu, 11 Sep 2008, jim grimsby Jr. wrote:
>
>> Date: Thu, 11 Sep 2008 18:02:16 -0700
>> From: jim grimsby Jr. <[EMAIL PROTECTED]>
>> Reply-To: [email protected]
>> To: [email protected]
>> Subject: IE max follow up.
>>
>> Hi did the test Jeff request and still no go.
>> Sorry
>>
>