Jump to content
ausssieautomate

Can I communicate with these controls?

Recommended Posts

ausssieautomate

Heyas,

I am trying to insert data into an external application but I can't get the following script to work no matter combination of class references and title references I make to the specified window, see the attachments.The picture with the highlight is what I am trying to insert text into.

Any assistance is welcome.

Thank you.

Script.au3

 

Picture.PNG

Edited by ausssieautomate

Frequent sufferer of ID10T Syndrome and CRAFT (Can't Remember A "BLEEP" Thing)

Share this post


Link to post
Share on other sites
jdelaney

ControlSetText|ControlGetText...use the regex route on the Class

Edited by jdelaney

IEbyXPATH-Grab IE DOM objects by XPATH IEscriptRecord-Makings of an IE script recorder ExcelFromXML-Create Excel docs without excel installed GetAllWindowControls-Output all control data on a given window.

Share this post


Link to post
Share on other sites
ausssieautomate

ControlSetText|ControlGetText...use the regex route on the Class

What do you mean?

Thank you. ​


Frequent sufferer of ID10T Syndrome and CRAFT (Can't Remember A "BLEEP" Thing)

Share this post


Link to post
Share on other sites
ausssieautomate

Hi  Jdelaney,



Not sure what you mean but I tried entering in the handles of the textboxes directly   ControlSetText($hWnd, "", "0x00210194", "sdfdsa"), unfortunately that doesn't work either.



Thank you.


Frequent sufferer of ID10T Syndrome and CRAFT (Can't Remember A "BLEEP" Thing)

Share this post


Link to post
Share on other sites
l3ill

I have had better luck using the Advanced Mode Name (Class Identifier) given with things like this. (NAME u.Qute No.)

If you have tried this and failed it might just be a syntax issue.

Edit: Maybe an obvious point, but for sanity's sake you could try ControlSend

 

Edited by l3ill

Share this post


Link to post
Share on other sites
ausssieautomate

Hi I3ill,

What is the Advanced Mode Name (Class Identifier) given with things like this. (NAME u.Qute No.)?

Tried controlsend didn't work either :(.

Thank you.

 


Frequent sufferer of ID10T Syndrome and CRAFT (Can't Remember A "BLEEP" Thing)

Share this post


Link to post
Share on other sites
SadBunny

First things first.

  • Does the WinActivate work? (If you background the window, then run the script, does it make it active?)
  • Is the ClassNameNN always the same or does it change every time you start the program, if the latter, is there a part that is always the same? (That is where the regex matching may come in handy, see below)
  • Is the What does the ControlGetText return? 

About regex: you can use REGEXPCLASS instead of CLASS or CLASSNN to specify a regular expression which the classname of the targeted control has to match, instead of a literal match. If you don't know what a regular expression is, check the wiki or google for a myriad of tutorials/explanations etc.Very useful if you need to define a pattern of text to look for that is more complicated than just a direct substring.

On a personal note: Brisbane! Going there in two weeks for a pedal steel guitar "festival" (quotes because the organizer may be exaggerating) :) I'll be there for a weekend.


Roses are FF0000, violets are 0000FF... All my base are belong to you.

Share this post


Link to post
Share on other sites
ausssieautomate

Hi SadBunny,

Your advice has helped me do some further analysis yes the classname in question changes between 2 values:

WindowsForms10.Window.8.app.0.2bf8098_r34_ad1

WindowsForms10.Window.8.app.0.2bf8098_r36_ad1

Bearing this in mind the following line should work but it doesn't any ideas :(:

ControlSend($hWnd, "[REGEXPCLASS:WindowsForms10\.Window\.8\.app\.0\.2bf8098_r3[64]_ad125]", "testing")

Also Winactivate works, so no issues there.

Thank you.


Frequent sufferer of ID10T Syndrome and CRAFT (Can't Remember A "BLEEP" Thing)

Share this post


Link to post
Share on other sites
ausssieautomate

Hi I3Bill,

Thanks for the update no Advanced Mode Name (Class Identifier) didn't work either :(.

My last hope is the regex route. 

ControlSend($hWnd, "[REGEXPCLASS:WindowsForms10\.Window\.8\.app\.0\.2bf8098_r3[64]_ad125]", "testing").

Two possible values from the selected field:

WindowsForms10.Window.8.app.0.2bf8098_r34_ad1

WindowsForms10.Window.8.app.0.2bf8098_r36_ad1

Can someone review my ControlSend command, should this work or is something missing?

Thank you. 


Frequent sufferer of ID10T Syndrome and CRAFT (Can't Remember A "BLEEP" Thing)

Share this post


Link to post
Share on other sites
ausssieautomate

Heyas,

Any suggestions for my above request.

Thank you 


Frequent sufferer of ID10T Syndrome and CRAFT (Can't Remember A "BLEEP" Thing)

Share this post


Link to post
Share on other sites
SadBunny

1) I know I asked it before, but what does the ControlGetText return? (Or rather: can you get it to return the text in that control?)

2) Your regex looks fine, but it describes the legacy CLASSNN string, which is the CLASS + INSTANCE. I'm not sure but I don't think it works that way (didn't test it). I think you have to use the REGEXPCLASS to define the actual classname (apparently ending in ad1), and then the INSTANCE to specify the actual instance (though I believe that's optional if there's only one instance of that class).


Roses are FF0000, violets are 0000FF... All my base are belong to you.

Share this post


Link to post
Share on other sites
ausssieautomate

Hi SadBunny,

BINGO!!! it's working. Thank you very much.

Also thanks to I3ill.

Thank you. 

  • Like 1

Frequent sufferer of ID10T Syndrome and CRAFT (Can't Remember A "BLEEP" Thing)

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

×