[jawsscripts] Re: HSC and switching sets
- From: "Geoff Chapman" <gch@xxxxxxxxxxxxxxxx>
- To: <jawsscripts@xxxxxxxxxxxxx>
- Date: Tue, 27 Nov 2007 02:06:04 +1100
hi Gian.
hmmm. well, I'm no fancy scripter myself yet I'm afraid, and unfortunately,
because I've been just flat stick working on a really big project for the last
8 months, I'm also now rather out of touch with hsc and it's precise
capabilities as well just right at the moment.
so, if in the least helpful, let me just wander through a couple of half
thoughts, and see if we can't stumble around to some kind of solution together
on what you want?
I'd firstly intimate to you, that I believe what you have described below that
you would like, should be quite possible. it's just working the bestest way of
achieving it given the environment, that is just so difficult to discuss,
especially when I no longer have all the cards of just what hsc is capable of,
in my hands/head any longer.
I do also have an answer to your frame queery as well, wanting to SayFrame of
only a certain color, but doing so from within a script.
But, problem is i need to sleep right now and so cannot anser you decently
comprehensively,
for another few hours yet.
if your desperate re time though and want a legUp pointer in case you wanna
follow the lead yourself until I can get back to you on it, the magic function
I believe you need to investigate the use of, to load hotSpot sets within
scripts,
is:
HscActivateThisSet ("SetName", {single integer, 0 to load silently, 1 to
speak.})
as you see, it takes two parameters, the first one is a string parameter,
being the name of the set you wish activated, which will, like all strings,
need to be in quotes,
followed by a comma, then an integer parameter, set to 0, if you don't want the
name of the set being spoken as it loads,and set to 1, if you do.
usually you'd set it to 1 until you're sure it's all working as expected, I.e.
to debugg, then set it to 0 when your confident it's working good, so as to get
less in the way of the user feedback etc.
There might have to be careful caveats done though I reckon, so as to have the
script in which you utilized all this toggling with one keypress, if indeed you
wanted to utilize it from within script land, though see below, this *may* not
be necessary,
really check to see which environment/window of your two, was really active,
before blindly just going and doing it's stuff.
I know I haven't done you a step by stepper on this one, and I know tha'ts
probly what you want, but I just wanna sleep now and I'll try and do more
tomorrow. thing Is, I'd have to do a fair bit of testing myself on this, just
to work out how exactly it would be optimal when to hand the functionality over
to hsc land, from your script, and Utilizing the major hotspot activator
function,
HscAssignHotSpot
to then have it work out which spot set was loaded, and thus which spot to
assign the controlShiftS key to activate, and then toggle the loading of the
alternate set after that,
and all that milarki.
It'll be a bit of work to suss out, from that end, but, as I think of it,
one other pointer that might just work, and that I'll thus suggest you might
like to try,
is, in hsc land itself, as a simplistic approach, you can, in your hotSpot
definition, like after you've had it do a click somewhere as an action etc,
jump to the bottom of your spot definition, with control+end, then hit end,
then hit control+m to make a New blank line at the bottom of the hotspot
definition,
and then actually manually shove in a new line in the spot definition,
what hsc calls it's "post processing function,"
i.e. a function to activate the new hotSpot set, after doing that particular
hotspot action.
it would look like this:
function=Pause|HscActivateThisSet("ScratchLive Setup Window", 1)
the pause is arbitrary and may not need to be there, just depends on how fast
your system is etc, and whether it needs time to respond after the hotspot
action.
then, in the other set, just do the same thing. have it's controlShiftS hotspot
do it's action, then place the postProcessing hsc function at the bottom of,
it's, hotspot definition, just as above, except this time, with it calling the
alternate hotspot set, i.e.:
Function=Pause|HscActivateThisSet("ScratchLive", 1)
The secret about getting SayFrame to work from inside a script, is firstly,
that the name of the frame needs to be in quotes, which you didn't have it in
your example, which is why the compiler thought it was meant to be a varyable,
so bawked at you and complained.
But, the only cludgy way I worked around it when I too needed only the text of
a certain color within a larger frame, to get spoken if it was present, was to
actually use another function instead of SayFrame, called
GetTextInRect.
now normally, this thing can cope with just 4 parameters, in absolute relative
screen terms by the way, Left Edge, top, rightEdge, and Bottom, of the
rectangle/frame area, you want this to occur in.
But, actually it can take a whole bunch more parameters as well, 9 in fact,
if you look in that fsdn helper file thinggy, or just start trying to write the
whole function from within the controlI dialog box, and check out the
descriptions along the way for each parameter as you go, you'll find out the
other 4 parameters that I had to shove in to this, making 8 in all, before it
would do as I wanted, and speak only text of a certain color/attribute.
the fifth parameter was the attribute stuff, (I set this to 0 for just
foreGround and backGround color usage,) the 6th one was the foreGround color,
(which you can use double click of hsc's alt+shift+NumPad5 key to help you grab
beforehand and pasted somewhere for insersion here,)
Use the actual words, IgnoreColor, if you don't care about color of either
foreGround or Background,)
7th parameter was the background color, and the 8th one, was whether you
wanted it to grab it as one long string, or with lineBreaks.
the 9th one was a braille or graphics label parameter, which I didn't
understand, so I just answered 0 for it, to let the thing complete, then I
deleted that last parameter out, and it seemed to be happy.
you might not even need to bother with parameter 8, I'm not totally sure now, I
can't remember.
hope this helps a bit anywayz man, let us know if this gets you by or not eh?
----- Original Message -----
From: GianniP46
To: JawsScriptsList
Sent: Sunday, November 25, 2007 9:35 PM
Subject: [jawsscripts] HSC and switching sets
Hi,
In my ap that I am scripting, there are two windows that jaws cannot really
differentiate between. The first window is the main window which is called the
"scratchLive" set and the second window is the setup window which is called the
"ScratchLive Setup Window". I have those two sets created with different
hotspots in each. there is one common hotspot in both and that is the setup
hotspot {Control+Shift+S}. My question, is it possible to automatically switch
from one set to the other set when I activate the Setup hotspot? For example,
if I am in the main window and I press {Control+Shift+S}, I would like for the
setup hotspot to be activated and then for the ScratchLive Setup Window set to
be loaded. Then, when I exit the setup window with the same hotspot, I would
like to switch back to the ScratchLive Set.
Am I dreaming? or is this possible?
Thanks Guys, you have been all so helpful with this project.
Gian Carlo Pedulla
GianniP46@xxxxxxxxxxxxx
LETS! GO! METS!
- References:
- [jawsscripts] HSC and switching sets
- From: GianniP46
Other related posts:
- » [jawsscripts] HSC and switching sets
- » [jawsscripts] Re: HSC and switching sets
- [jawsscripts] HSC and switching sets
- From: GianniP46