ausssieautomate Posted June 3, 2015 Share Posted June 3, 2015 (edited) 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 Edited June 3, 2015 by ausssieautomate Frequent sufferer of ID10T Syndrome and CRAFT (Can't Remember A "BLEEP" Thing) Link to comment Share on other sites More sharing options...
jdelaney Posted June 3, 2015 Share Posted June 3, 2015 (edited) ControlSetText|ControlGetText...use the regex route on the Class Edited June 3, 2015 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. Link to comment Share on other sites More sharing options...
ausssieautomate Posted June 3, 2015 Author Share Posted June 3, 2015 ControlSetText|ControlGetText...use the regex route on the ClassWhat do you mean?Thank you. Frequent sufferer of ID10T Syndrome and CRAFT (Can't Remember A "BLEEP" Thing) Link to comment Share on other sites More sharing options...
ausssieautomate Posted June 3, 2015 Author Share Posted June 3, 2015 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) Link to comment Share on other sites More sharing options...
l3ill Posted June 3, 2015 Share Posted June 3, 2015 (edited) 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 June 3, 2015 by l3ill My Contributions... SnippetBrowser NewSciTE PathFinder Text File Manipulation FTP Connection Tester / INI File - Read, Write, Save & Load Example Link to comment Share on other sites More sharing options...
ausssieautomate Posted June 3, 2015 Author Share Posted June 3, 2015 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) Link to comment Share on other sites More sharing options...
SadBunny Posted June 3, 2015 Share Posted June 3, 2015 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. Link to comment Share on other sites More sharing options...
ausssieautomate Posted June 3, 2015 Author Share Posted June 3, 2015 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_ad1WindowsForms10.Window.8.app.0.2bf8098_r36_ad1Bearing 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) Link to comment Share on other sites More sharing options...
l3ill Posted June 3, 2015 Share Posted June 3, 2015 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. My Contributions... SnippetBrowser NewSciTE PathFinder Text File Manipulation FTP Connection Tester / INI File - Read, Write, Save & Load Example Link to comment Share on other sites More sharing options...
ausssieautomate Posted June 4, 2015 Author Share Posted June 4, 2015 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_ad1WindowsForms10.Window.8.app.0.2bf8098_r36_ad1Can 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) Link to comment Share on other sites More sharing options...
ausssieautomate Posted June 5, 2015 Author Share Posted June 5, 2015 Heyas,Any suggestions for my above request.Thank you Frequent sufferer of ID10T Syndrome and CRAFT (Can't Remember A "BLEEP" Thing) Link to comment Share on other sites More sharing options...
SadBunny Posted June 5, 2015 Share Posted June 5, 2015 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. Link to comment Share on other sites More sharing options...
ausssieautomate Posted June 5, 2015 Author Share Posted June 5, 2015 Hi SadBunny,BINGO!!! it's working. Thank you very much.Also thanks to I3ill.Thank you. SadBunny 1 Frequent sufferer of ID10T Syndrome and CRAFT (Can't Remember A "BLEEP" Thing) Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now