[jawsscripts] Re: Script seems to stop after a new web page appears.

  • From: "John P. Thomas" <johnt@xxxxxxxxxxxx>
  • To: <jawsscripts@xxxxxxxxxxxxx>
  • Date: Sat, 2 Feb 2019 07:01:29 -0500

Hi Darrell,

In addition to the good suggestions that were just offered below, I want to 
mention that I have not always received accurate behavior from the FindString 
function. As a result I don't use it very often.

Instead I use this form for my searches:

JAWSTopOfFile ()

SetJAWSFind ("TextToFind)

JAWSFindNext ()

I check my success by using the StringContains function
If StringContains (GetLine(), "TextToFind") then do what ever 

I realize that this is functionally the same as what you are doing, but for me 
it seems to be more reliable in some situations. I can't say why this would be.

John
 

-----Original Message-----
From: jawsscripts-bounce@xxxxxxxxxxxxx <jawsscripts-bounce@xxxxxxxxxxxxx> On 
Behalf Of Udo Egner-Walter
Sent: Saturday, February 2, 2019 04:05 AM
To: jawsscripts@xxxxxxxxxxxxx
Subject: [jawsscripts] Re: Script seems to stop after a new web page appears.

Hi Darrell,

I think it's not a good idea to do all the stuff in one script. Perhaps the 
script is not informed that the page has changed. Instead you can do something 
like this:

Keep in mind that the original script from you is the second script and the 
function to search the second word is the first script. This is because JAWS 
can't find the function if the function is below the script.


<code start>

void Function FindViewFile ()

; test temporarily if the function was executed and delete the line if so

SayString ("Okay let's search again")

if FindString(GetCurrentWindow(), "View file", s_top, s_unrestricted) then

SayString ("Found")

else

SayString("Found nothing")

EndIf

EndFunction



Script GetVoiceMail () ;SHIFT + CTRL + G

{Control + Home}

Delay (2)

If FindString (GetCurrentWindow (), "mp3", S_Bottom, S_Unrestricted) then

Delay (2)

EnterKey()

; a new web page appears at this point.

; so execute a function after 6 seconds

ScheduleFunction ("FindViewFile", 60)

EndIf

EndScript

<code end>

Instead to pause the script for 6 seconds you can also try this:

<code start>

Script GetVoiceMail ()

...

ScheduleFunction ("FindViewFile", 10)

...

EndScript


void Function FindViewFile ()

...

if !FindString(GetCurrentWindow(), "View file", s_top, s_unrestricted) then

; search again after a second

ScheduleFunction ("FindViewFile", 10)

...

EndFunction

<code end>


I hope this helps

Udo



Am 02.02.19 um 00:40 schrieb Darrell Shandrow Hilliker:

Hi Everyone,
  

Please take a look at the following code, including all comments, and 
let me know if you have any ideas as to why everything seems to stop 
after a new web page appears.

  

Please keep in mind this has been added to  part of the Google Chrome 
primary script set, so it does not matter if the website domain 
changes, etc.

  

Script GetVoiceMail () ;SHIFT + CTRL + G

{Control + Home}

Delay (2)

If FindString (GetCurrentWindow (), "mp3", S_Bottom, S_Unrestricted) 
then

Delay (2)

EnterKey()

;a new web page appears at this point.

Delay(60)

;JAWS seems to perform these steps, but nothing else no matter what I try.

if FindString(GetCurrentWindow(), "View file", s_top, s_unrestricted) 
then

beep() ;This never happens.

else

SayString("nothing") ;This always happens.

EndIf

Else

SayString ("text not found on screen")

EndIf

EndScript

  

Thanks,

  

Darrell

  

  

  



__________ 

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

__________ 

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

__________�

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

Other related posts: