Making the script tick a checkbox in an application no mouse

Technical support and scripting issues

Moderators: Dorian (MJT support), JRL

Post Reply
User avatar
Phil Pendlebury
Automation Wizard
Posts: 538
Joined: Tue Jan 16, 2007 9:00 am
Contact:

Making the script tick a checkbox in an application no mouse

Post by Phil Pendlebury » Fri Jan 19, 2007 11:25 am

Sorry if the topic is confusing... Although I am a beginner I suspect that this may not be a beginner's problem:

In the application that I am running my script on there are a number of check boxes in the program's dialog.

There are no shortcut keys or ALT+ commands to check or un-check these boxes.

The only way to check / un-check them is withe the mouse.

I can't use mouse automation in this script for various reasons.

So my question: Is there some way to make the script check / un-check these boxes. I have a feeling it may be something to do with the "handle" command but only a feeling :-)

If anyone could point me in the right direction or indeed just tell me to "give up" I would really appreciate it.

Thanks again,

Phil.
Phil Pendlebury - Linktree

User avatar
Marcus Tettmar
Site Admin
Posts: 7380
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Fri Jan 19, 2007 11:32 am

Are you sure there really are no ALT shortcuts?

If not, here are some alternatives:

1. TAB to the checkbox. ALL fields on a Windows GUI can be TABbed to. Press tab to move from field to field. Therefore you can first SetFocus to the window, then Press Tab the required number of times to get to the checkbox. E.g:

SetFocus>window_title
Press Tab * 10

This will press tab 10 times. You just need to determine how many tabs are required to get to the checkbox.

Now you just need to check/uncheck the checkbox. You can do that by hitting the SPACE bar. Once you have tabbed to a checkbox and therefore given it focus, a space will toggle it. So now you can do:

Send>SPACE

2. Another option is to try using the GetCheckBox and SetCheckBox functions that are built in. E.g:

SetCheckBox>window_title,check_box_label,TRUE

3. If #2 fails to work it is probably a non-standard checkbox control, not using the Windows common controls. Another option is to use Image Recognition. Use the Image Recognition functions to locate the checkbox and click on it. Image Recognition is incredibly powerful. For a demo of the image recognition functions see:
http://www.mjtnet.com/blog/2006/10/11/s ... cognition/
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

User avatar
Phil Pendlebury
Automation Wizard
Posts: 538
Joined: Tue Jan 16, 2007 9:00 am
Contact:

Post by Phil Pendlebury » Fri Jan 19, 2007 3:52 pm

Thank you again,

Your fantastic support has already justified the payment for this tool! :-) I'm sure one of your solutions will work (probably the space bar + tab combi).

However, I have just been through the video for the screen recog feature... All I can say is wow!

Thank you once again.

Stand by... there will be more questions. :-)
Phil Pendlebury - Linktree

Post Reply
cron
Sign up to our newsletter for free automation tips, tricks & discounts