topbanner_forum
  *

avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • Saturday December 14, 2024, 5:30 pm
  • Proudly celebrating 15+ years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Author Topic: Help needed for select and deselecting a checkbox  (Read 8812 times)

rainbal

  • Participant
  • Joined in 2009
  • *
  • default avatar
  • Posts: 2
    • View Profile
    • Donate to Member
Help needed for select and deselecting a checkbox
« on: July 28, 2009, 01:30 PM »
Hi,

Using winactive, we can activate a window but how to uncheck and check a box ? What is the command for it, as i need it but the check box is inside a java window.

Please help

Thanks a lot

SleepingWolf

  • Supporting Member
  • Joined in 2007
  • **
  • Posts: 118
    • View Profile
    • Read more about this member.
    • Donate to Member
Re: Help needed for select and deselecting a checkbox
« Reply #1 on: August 02, 2009, 01:36 PM »
First step, specify whether you're working with AutoIt or AutoHotkey or other...

Have you checked the appropriate websites/ forums. I'm sure the answers will be a search away... ;D
-------------------------------------------

Question everything, use a fact-checker.
Respect yourself and respect others.
Peace out!

rainbal

  • Participant
  • Joined in 2009
  • *
  • default avatar
  • Posts: 2
    • View Profile
    • Donate to Member
Re: Help needed for select and deselecting a checkbox
« Reply #2 on: August 06, 2009, 07:12 AM »
Hi,

I want to write script with Autohotkey only. I've the website but couldn't find anything.

Thanks for your reply.

JoTo

  • Super Honorary
  • Charter Member
  • Joined in 2005
  • ***
  • Posts: 236
    • View Profile
    • Donate to Member
Re: Help needed for select and deselecting a checkbox
« Reply #3 on: August 06, 2009, 07:35 AM »
Hi there,

I don't use AHK but only AutoIT. But my suggestion should work anyway in AHK as well, as this is standard behaviour from operating system.

A windows checkbox can set by keypresses like this (don't know if JAVA behaves like a standard windows checkbox though):

- Plus sign (+) force to checked state. If its already checked it will stay checked.
- Minus sign (-) force to unchecked state. If its already unchecked it will stay unchecked.
- SpaceBar toggles the checkbox. So if it's unchecked it gets checked and vice versa.

So make the checkbox to have the focus by an AHK command and then use an AHK command to send keystrokes as described above (in AutoIt this would be the SendKeys-command - dunno for AHK though).

HTH
JoTo

SleepingWolf

  • Supporting Member
  • Joined in 2007
  • **
  • Posts: 118
    • View Profile
    • Read more about this member.
    • Donate to Member
Re: Help needed for select and deselecting a checkbox
« Reply #4 on: August 06, 2009, 03:29 PM »
Another approach, if you know the window has roughly the same dimensions each time you use it, just guide the mouse to the right spot and then send a mouse click. This way might be easier as you don't need to get a list of controls and then work out which one you want. That would be the best way of course, once you've done the hard work of programming it. My way above would be a quick hack.

In case you're wondering though, people are less likely to devote time to programming a solution they can't test. Which java program are you using and which screen is it you need help with? Maybe you could post a picture of it? Without such info you're likely to get only general advice. Good luck.
-------------------------------------------

Question everything, use a fact-checker.
Respect yourself and respect others.
Peace out!
« Last Edit: August 06, 2009, 03:33 PM by SleepingWolf »