Henry,

The Click command depends on at least two things...first that there's an
element like the one it specifies "Search<INPUT>[EMAIL PROTECTED] View" and
second that the element is after the current Selected item which looks like
it's the <SELECT> element.  For the first, you can try liberalizing the
specification as in just "#search#".  For the second putting a First command
starts the search for your element from the beginning of the page.

As to the second issue you've mentioned, Boston WorkStation starts up with
its application viewer window by default.  If you add the /web parameter to
its command line, it will start with the WebStation, as in:

        Bss70.exe /web

Rich McNeil
Boston Software Systems
866 653 5105
www.bostonworkstation.com
-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of
[EMAIL PROTECTED]
Sent: Monday, July 26, 2004 10:55 AM
To: [EMAIL PROTECTED]
Subject: RE: [Talk] Drop down boxes on web pages


Okay, thanks, Rich.

I have a follow up question now to Thom's email.  I have the code working
to select the right drop down option, but the Click command I place after
it doesn't work.  The code just sticks in a running state when it tries to
perform the Click.  Here's the code:

Sub myScript1()
    Connect "", stWeb
    Go_ "http://portal/portal/hpp_signin.jsp";
    Pause "Sign In<B>@Horizon Physician Portal"
    Text("[EMAIL PROTECTED] Physician Portal") = "userid"
    Text("[EMAIL PROTECTED] Physician Portal") = "password"
    Click "Once you have entered your Use*<INPUT>[EMAIL PROTECTED] Physician
Portal"
    Pause "My Main View<B>@Main View"
    Click "View Users<A>@Main View"
    Pause "Admin<FONT>@Main View"
    Text("[EMAIL PROTECTED] View") = "622" '  622
    Pause " Ungrouped Users~~~~~~~~~~~~~~*<SELECT>[EMAIL PROTECTED] View"
    GetListItem "Physician Portal User"
    Click "Search<INPUT>[EMAIL PROTECTED] View"

End Sub

Sub GetListItem(ItemName As String)
    Set e = Web.Selected
    For i = 0 To e.options.length
        OptName = e.options(i).innerHTML
        If ItemName = e.options(i).innerHTML Then
            e.selectedindex = i
            Exit Sub
        End If
    Next
End Sub

The Click "Search<INPUT>[EMAIL PROTECTED] View" command does not work.
Actually, it doesn't seem to want to click that button no matter what.  I
even put that single command in another sub and it still hangs.

Also, shouldn't the Connect "", stWeb command connect the script to the Web
server?  It seems like the script won't run unless I first manually click
the Connect menu and select Web.  Or am I misunderstanding something?

Henry Taylor
Technical Analyst II
Lutheran Health Network
Ph. (260) 425-3914


|--------+-------------------------------->
|        |          "Rich McNeil"         |
|        |          <[EMAIL PROTECTED]>   |
|        |          Sent by:              |
|        |          [EMAIL PROTECTED]|
|        |          TATION.COM            |
|        |                                |
|        |                                |
|        |          07/26/2004 08:38 AM   |
|        |          Please respond to Talk|
|        |                                |
|--------+-------------------------------->
 
>---------------------------------------------------------------------------
--------------------------------|
  |
|
  |      To:     <[EMAIL PROTECTED]>
|
  |      cc:
|
  |      Subject:     RE: [Talk] Drop down boxes on web pages
|
 
>---------------------------------------------------------------------------
--------------------------------|




Henry,

The HTML document object model is extremely complex...hundreds of classes
with thousands of methods, properties and events...and we do our best to
protect you from it.  But, sometimes it's necessary to use them.

Our approach for this is much like the rest of Boston WorkStation...try to
figure it out and call us if you need help.

References can be found in one of those big computer references in the
bookstore or on Microsoft.com, for example the innerHTML property is at:

http://msdn.microsoft.com/library/default.asp?url=/workshop/browser/mshtml/r

eference/ifaces/ihtmlelement/innerhtml.asp

Rich McNeil
Boston Software Systems
866 653 5105
www.bostonworkstation.com
-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of
[EMAIL PROTECTED]
Sent: Monday, July 26, 2004 8:11 AM
To: [EMAIL PROTECTED]
Subject: RE: [Talk] Drop down boxes on web pages


This worked.

I'm curious about the properties and methods you used, though.  Are those
documented somewhere?  I sure didn't see them in the Online Documentation.
But then, I for sure could have missed them.

Henry Taylor
Technical Analyst II
Lutheran Health Network
Ph. (260) 425-3914


|--------+-------------------------------->
|        |          "Thom C. Blackwell"   |
|        |          <[EMAIL PROTECTED]>   |
|        |          Sent by:              |
|        |          [EMAIL PROTECTED]|
|        |          TATION.COM            |
|        |                                |
|        |                                |
|        |          07/24/2004 08:15 AM   |
|        |          Please respond to Talk|
|        |                                |
|--------+-------------------------------->

>
---------------------------------------------------------------------------
--------------------------------|
  |
|
  |      To:     <[EMAIL PROTECTED]>
|
  |      cc:
|
  |      Subject:     RE: [Talk] Drop down boxes on web pages
|

>
---------------------------------------------------------------------------
--------------------------------|




Greetings,
I am going to make an assumption here that you are talking about an "HTML"
dropdown as opposed to Flash or something else type dropdown - let me know
if you have to address something along these lines - the approach needed
may
be different.

Below is an example script that illustrates finding a particular item in a
list. I made the "part that does the selecting" a generic sub routine so
you
could reuse it to find other items at will. (This will also be posted to
the
script center on Monday).

To use this code, first have a Pause command for the dropdown. This is very
important; reason being is that the Pause sets Web.Selected to the dropdown
- without the pause, this will not work!

The loop then scans through available dropdown options until it finds and
sets the dropdown to the one you are looking for.

Here's the example - say you wanted to shop for Toys on Amazon.com, you'd
use the following:

Sub test()
Connect "", stWeb
Go_ "amazon.com"
'Here's my Pause for the dropdown
Pause " All ProductsBooksPopular Musi*<SELECT>[EMAIL PROTECTED]: Welcome"
GetListItem "Toys"
Click "Go<INPUT>[EMAIL PROTECTED]: Welcome"
End Sub

'Here's the part that really does the work

Sub GetListItem(ItemName As String)
 Set e = Web.Selected
            For i = 0 To e.options.length
                If ItemName = e.options(i).innerHTML Then
                    e.selectedIndex = i
'The Go command is optional - use if the act of selecting an item is
'designed to navigate to another page, do not use if you are just selecting
'a value and clicking on a button or similar
                    'Go_ e.options(i).Value
                              Exit Sub
                End If
            Next i
End Sub

Hope this helps - any questions?

Regards and happy scripting!
Thom

Thom C. Blackwell
Product Manager
Boston Software Systems
866.653.5105














Reply via email to