Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


how to 'click' on a button

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

 

 
  
  Printable Version
All Forums >> [Scripting] >> WSH & Client Side VBScript >> how to 'click' on a button
  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 >>
 how to 'click' on a button - 5/1/2008 6:59:42 PM   
  inosent

 

Posts: 3
Score: 0
Joined: 5/1/2008
Status: offline
i have a prog i use that crunches numbers. using VBScript i need to 'find' this button on the face of the program called 'Calculate' and 'click' on it. it is *really* annoying there is no file menu option for it, but that is the way it goes.

this is what i have so far

      
all it does is finds the app, opens the open file dialogue, fills in a file name and enters data from the file, etc

but the next step is i need to 'click' on the 'Calculate' button to crunch the numbers, but i dont know how to do that. it is a big orange thing in the middle of the program, and when u scroll over it u get a label/text tip that says 'Calculate' as well

so the question is, what is the best way to find that button, and then using vb script code 'click' on it so the prog will crunch the number?

thanks!


 
 
Post #: 1
 
 RE: how to 'click' on a button - 5/1/2008 11:00:08 PM   
  TNO


Posts: 1036
Score: 10
Joined: 12/18/2004
From: thenewobjective.com
Status: offline
Is it safe to assume the tab key won't let you move focus around the screen? If the program only has a button (which you can't put focus on) and a file menu, then the only way would be to use AutoIt think to have the mouse move around to the button.

_____________________________

Consolidated Script Component: The Acid Test

A universe of complexity...

(in reply to inosent)
 
 
Post #: 2
 
 RE: how to 'click' on a button - 5/2/2008 12:48:56 AM   
  Rischip


Posts: 378
Score: 2
Joined: 3/26/2007
Status: offline
What happens when you have focus on the application and you press the ALT key? Maybe the button is programmed for a hotkey which you could simulate with sendkeys the way you have in the rest oof the code you posted.

_____________________________

Rischip
Author of - The Grim Linker

(in reply to TNO)
 
 
Post #: 3
 
 RE: how to 'click' on a button - 5/2/2008 7:00:10 AM   
  inosent

 

Posts: 3
Score: 0
Joined: 5/1/2008
Status: offline
yeah, unfortunately no tab key action, and no alt hotkey either :(

soooo

could u give me a working example of AutoIt?  i think the only way to hit the button is to 'move' the mouse over it and 'click' on it. i just dont know the code for how to do this

thanks for the reply!

(in reply to TNO)
 
 
Post #: 4
 
 RE: how to 'click' on a button - 5/4/2008 7:57:16 AM   
  Fredledingue


Posts: 321
Score: 0
Joined: 5/9/2005
From:
Status: offline
AutoItX is component that you canuse as an object in VBS.

http://www.autoitscript.com/autoit3/files/beta/autoitx/


      

Here is what it can do


      

In your case you can either move the mouse pointer to an exact loccation on the screen if the button is always at the same place. You can also move the winow first then the mouse.
Or move the mouse until it finds the orange color or some caption on a button. It can do many things of this kind

HTH

_____________________________

Fred

(in reply to inosent)
 
 
Post #: 5
 
 
 
  

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 >> how to 'click' on a button 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