Jump to content
Sign in to follow this  
jbarchibald

Space in Control Name

Recommended Posts

jbarchibald

I have an older application and there are padded spaces in the name of the control.

for example, one ok button would be ' &OK' and another would be ' &OK'

is there anyway to have autoIT ignore the spaces ?

more specifically I'm using the following command

ControlClick("Form Title", "" , "[TEXT: &OK]")

and unless I get the spaces exactly right, it fails to find the object.

for this application, from past experience with Winrunner, I would prefer to stay away from Control ID's. they are not always the same from machine to machine.

Thoughts ?

- Jason

Share this post


Link to post
Share on other sites
evilertoaster

programatically-

ControlClick("Form Title", "" , StringReplace("[TEXT: &OK]"," ",""))

But why not just remove it youself?

ControlClick("Form Title", "" , "[TEXT:&OK]")

Share this post


Link to post
Share on other sites
Ysengrim

I have an older application and there are padded spaces in the name of the control.

for example, one ok button would be ' &OK' and another would be ' &OK'

is there anyway to have autoIT ignore the spaces ?

Can you use the "search and replace" option in the menu ?

I always use that for such jobs

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×