Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


have a vb script that can command a java script to run on a web page

 
Logged in as: Guest
arrSession:exec spGetSession 2,2,65413
 Active Users: There are 0 members and 0 guests.
 Users viewing this topic: none
 

 

 
  
  Printable Version
All Forums >> [Scripting] >> WSH & Client Side VBScript >> have a vb script that can command a java script to run on a web page
  Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Page: [1]
Login
Message << Older Topic   Newer Topic >>
 have a vb script that can command a java script to run ... - 10/22/2008 5:46:21 AM   
  discipulus81

 

Posts: 2
Score: 0
Joined: 10/22/2008
Status: offline
I want to write a script that can click a button that executes a java script on a webpage. 

So far I have:

Set oIE = WScript.CreateObject("InternetExplorer.Application")
Set WshShell = WScript.CreateObject("WScript.Shell")
oIE.visible = 1
oIE.navigate "http://some_webpage.htm"


Do While (oIE.Busy)
WScript.Sleep 200
Loop

 
When I hold my mouse over the button I want to execute it says java:some_func. 
 
I am new to both vbs and java script so I don't understand how they interact.  I tried to use oIE.GetProperty on the java script and its vars but I don't think I am using it correctly.
 
 
Post #: 1
 
 RE: have a vb script that can command a java script to ... - 10/22/2008 6:11:04 AM   
  ebgreen


Posts: 5251
Score: 31
Joined: 7/12/2005
Status: offline
If you just want to have the page do whatever happens when a button is pushed, just use the .Click() method of the button.

_____________________________

"... when you are good and crazy, oooh, oooh, oooh, the sky is the limit!" - The Tick
Goog places to start:http://www.visualbasicscript.com/m_24727/tm.htm
http://www.visualbasicscript.com/m_47117/tm.htm

(in reply to discipulus81)
 
 
Post #: 2
 
 RE: have a vb script that can command a java script to ... - 10/22/2008 7:07:57 AM   
  discipulus81

 

Posts: 2
Score: 0
Joined: 10/22/2008
Status: offline
how would I get down to the click method of the button. 

would it be oIE.document.button.click() ?


(in reply to discipulus81)
 
 
Post #: 3
 
 RE: have a vb script that can command a java script to ... - 10/22/2008 7:16:58 AM   
  ebgreen


Posts: 5251
Score: 31
Joined: 7/12/2005
Status: offline
Essentially. Except that you would use the button's name or ID (I forget which) instead of 'button'.

_____________________________

"... when you are good and crazy, oooh, oooh, oooh, the sky is the limit!" - The Tick
Goog places to start:http://www.visualbasicscript.com/m_24727/tm.htm
http://www.visualbasicscript.com/m_47117/tm.htm

(in reply to discipulus81)
 
 
Post #: 4
 
 
 
  

If you found our site useful please link to us <a href="http://www.visualbasicscript.com">VisualBasicScript.com</a>.
All Forums >> [Scripting] >> WSH & Client Side VBScript >> have a vb script that can command a java script to run on a web page Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts