[jawsscripts] Re: Anyone use NetLimiter2Pro? JAWS scripts won't work...

JAWSKey+Q will say "Default scripts are loaded" unless you put
something like this in your scripts:

script ScriptFileName()
ScriptAndAppNames("NetLimiter2Pro")
endScript

You might want to be a little more careful in your FocusChangedEventEx
though.  I recommend two things:  First, put "if h then" above and
"endIf" below your setFocus line, so setFocus is only called if your
window is found.  This is minor in the code as it stands now, because
I don't think much happens if you setFocus(0)... but my second
recommendation is that you put a "return" below setFocus and above the
new endIf line, so you actually replace the focusChangedEventEx call
that landed in the wrong place with one that lands in the right one.

I also don't see equal signs in your two constant definition lines,
which should cause a compile error if that's actually what's in your
code file.

On Thu, Nov 13, 2008 at 07:08:34PM -0800, Bryan Garaventa wrote:
Hi, I've been using NetLimiter2Pro for a while now, and wrote the scripts 
below, which used to work fine. Now though, the scripts won't load, even 
though the program has focus by alt+tabbing into it.
Insert+Q says the correct executable name, but the relevant JSB file will 
not load. Anyone know why this might be happening?


; Script Code

include "hjconst.jsh"

const

s_main_class "NetLimiter Main",

s_ie "Internet Explorer_Server"

Void Function FocusChangedEventEx (handle hwndFocus, int nObject, int 
nChild, handle hwndPrevFocus, int nPrevObject, int nPrevChild, int 
nChangeDepth)

if GetWindowClass (GetFocus ()) != s_ie then

var handle h

let h = FindWindow (GetFocus (), s_ie, "")

SetFocus (h)

endif

FocusChangedEventEx (hwndFocus, nObject, nChild, hwndPrevFocus, nPrevObject, 
nPrevChild, nChangeDepth)

EndFunction

Script SetFocus ()

; Assigned Alt+Shift+f

Say ("Setting Focus", 0, false)

if GetWindowClass (GetFocus ()) != s_ie then

var handle h

let h = FindWindow (GetFocus (), s_ie, "")

SetFocus (h)

endif

EndScript



; End of code

__________?
Visit and contribute to The JAWS Script Repository http://jawsscripts.com

View the list's information and change your settings at 
http://www.freelists.org/list/jawsscripts

-- 
Doug Lee, Senior Accessibility Programmer
SSB BART Group - Accessibility-on-Demand
mailto:doug.lee@xxxxxxxxxxxxxxxx  http://www.ssbbartgroup.com
"While they were saying among themselves it cannot be done,
it was done." --Helen Keller
__________ 
Visit and contribute to The JAWS Script Repository http://jawsscripts.com

View the list's information and change your settings at 
http://www.freelists.org/list/jawsscripts

Other related posts: